-
Notifications
You must be signed in to change notification settings - Fork 45
Server Migration
This guide explains how to migrate the passwords database to a new server.
Warning: The passwords app backup will overwrite your server secret. We recommend importing the backup before setting up other apps & encryption.
- Log onto your old server and open the Nextcloud directory.
- Create a new backup
./occ passwords:backup:create migration
- Export the backup file
./occ passwords:backup:export migration
- Copy the file from the old server to the new server
If the file
scp ./migration.json.gz [email protected]:/path/to/new/nextcloud/
migration.json.gz
does not exist, your server probably does not support compression and you can try the following:scp ./migration.json [email protected]:/path/to/new/nextcloud/
- Now log onto your new server and open the Nextcloud directory
- Import the backup file (use the file name from step 5)
./occ passwords:backup:import migration.json.gz
- Restore the backup file with
./occ passwords:backup:restore migration
- Install OCC Web on both your Nextclouds
- Open OCC Web in your old Nextcloud
- Create a new backup
passwords:backup:create migration
- Export the backup file
passwords:backup:export migration
- Open your old server with FTP and open the Nextcloud folder.
- Download the
migration.json.gz
file (ormigration.json
if your server does not support compression) - Open your new server with FTP and open the Nextcloud folder.
- Upload the
migration.json.gz
file - Open OCC Web on the new Server
- Import the backup file
passwords:backup:import migration.json.gz
- Restore the backup file in OCC Web with
passwords:backup:restore migration
Just use gunzip migration.json.gz
or 7Zip to unzip the file.
Upgrade to 2019.8.0.
If you have access to your database, then you can dump all passwords tables (passwords_*
).
Also dump all entries from appconfig
where the appid
is "passwords".
Then dump all entries from preferences
where the appid
is "passwords".
Export the server secret with OCC Web (config:system:get secret
) or read it from the config.php.
Restore all the tables and the server secret on your new Server.
If you still have SSH, you can try to move the backups to a new Nextcloud instance with the following command:
curl -T 'data/<appdata_dir>/passwords/autoBackups/<some_file>' 'https://<new_cloud_domain>/remote.php/dav/files/<new_user>/' --user '<new_user>:<password>'
That's because this is not how this works.
If you get the error The file does not contain a valid server backup
or
This seems to be a client backup. It can only be restored using the web interface
then you are likely trying to import a backup which was not designed for the server backup.
If you have a backup from the app, then use the app to import it again.
These backups (client backups) are also only for a single user.
Use the guides above to create and export backups properly.
Upgrade the app to the latest version. Downgrading is not supported by backups because it does not work.
You can still try to restore passwords that were encrypted with SSEv1r1. All other passwords will be lost. Try this forum post.