Restoring from a Backup#
The database restore process is intended to restore an installation of the same version. It is not intended to likewise perform a version upgrade concurrently, as the database migrations will not run after importing the database, leading to data mismatch.
If you do not know what version your old installation was running, please contact us for assistance.
- Gather up all the files: you’ll need our backup-restore.sh script, the database backup file from your backup server (named
database.gz, ordatabase.gz.encfor the encrypted backups made by backup package 2.4.0 and later), and yoursynergycp-config-backup.tar.gzconfig backup file.
Encrypted backups are decrypted automatically by the restore script, using the secret key inside your configuration backup — this is why the configuration backup is required. To decrypt one manually (for example to inspect the SQL), use the
APP_KEYvalue from the.envin your configuration backup:openssl enc -d -aes-256-cbc -pbkdf2 -iter 100000 -md sha256 \ -pass "pass:$APP_KEY" < main-database.1077.gz.enc | gunzip > dump.sql
-
Upload all 3 of those files, using the same names above, to any one folder on your new SynergyCP master server. Make sure that server is a fresh server with nothing installed and meets all of the install requirements.
-
Run the restore script:
bash backup-restore.shas the root user on the new server from the directory with those 3 files.
The script verifies both backup files and asks for confirmation before it changes anything (pass
-yto skip the prompt for unattended runs), and it writes a full log torestore.login the same directory. If a run fails — for example because a file was corrupt in transit — you can fix the cause and simply run the script again on the same server: it detects the existing installation and resumes instead of reinstalling.
-
The DHCP & File server’s API key running on the main SynergyCP web instance will now be mismatched, since new API key information was generated during the install process. To update them:
cd /scp/pxe/dhcp ./bin/install.sh # Copy the info to the DHCP server on SynergyCP.cd /scp/pxe/file ./bin/install.sh # Copy the info to the File server on SynergyCP. -
Run switch scans on every switch to update the bandwidth polling configuration file that is stored on disk. This can be done in bulk using the checkboxes on the switch list page.
If you get a message to the effect of “MAC Address is invalid”, this signifies that the restore script did not replace your API key from the
synergycp-config-backup.tar.gzfile. Please contact us for assistance. -
We recommend deleting the config and database backup files from the new server once they have been imported successfully, along with the
restore.logfile the script wrote.
Getting help#
If the restore fails or the panel misbehaves afterwards, please open a ticket and attach the restore.log file from the directory you ran the script in. It contains the full output of every restore attempt on that server, which lets us pinpoint the failing step without back-and-forth.