Migrating to a new server

Page under construction.

Note: If you migrate from a multi-db (Agency) setup, you have to migrate all databases.

To migrate your UXWizz dashboard to a new server, you have to:

You can also use a database backup service like SimpleBackups.io. It's also useful and easy to use for regular, scheduled backups and alerting.

1. Migrate the MySQL database

Before migrating the database, it's a good idea to first remove all unnecessary data (e.g. old recordings, heatmaps, etc.) in order to reduce the database size as much as possible.

1.1 Backup the current database

UXWizz provides a script to back up the current database. Simply run this in your UXWizz folder:

sh /server/cron/ust_backup_dh.sh

1.2 Copy the .sql.gz file to the new server

We will use scp over ssh to copy the file directly to the new server.

1.2.1 Generate new SSH key

Skip if the new server uses password auth. This key is only used for the scp authentication.

On the original server, generate a new SSH key:

ssh-keygen -t rsa -b 4096
# View and CTRL+C copy the key
cat ~/.ssh/id_rsa.pub

On the new server, add the previously generated public key:

# Open the authorized keys file
nano ~/.ssh/authorized_keys

# Add a new line with the previous contents from id_rsa.pub
ssh-rsa AAAA_EXISTING_KEYS...
ssh-rsa AAAA_THE_NEW_KEY...

1.2.2 Copy the backup file

Finally, start copying the backup file (replace the filename and the IP to the new server IP)

scp your_backup.sql.gz root@12.45.67.89:/tmp/ust.sql.gz

1.3 Import the new database

On the new server, unzip the backup, create a new database (preferably with the same name as the old one) and import the sql file:

gunzip ust.sql.gz
mysql -u root -p -e "CREATE DATABASE new_database_name; USE new_database_name; SET autocommit=0 ; source ust.sql ; COMMIT;"

You might also have to create the same users as before. On the original server, you can see existing MySQL users and their permissions:

 apt-get install percona-toolkit
 pt-show-grants -u YOUR_MYSQL_USER -p YOUR_MYSQL_PASSWORD --database YOUR_UXWIZZ_DB

You can copy those grant commands and run them on the new MySQL instance to create the users and give grant privileges.

2. Copy the UXWizz folder

Assuming your installation folder is /var/www/html:

Make sure the folder exists on the new server: mkdir -p /var/www/html

On original server:
cd /var/www/
scp -r html root@12.45.67.89:/var/www/

Note: If you had cron jobs enabled, you should also copy the contents of crontab -e

3. Point your domain name to new server

Go to your domain name's DNS configuration and update the IP to point to the new server.

For any other server configuration (HTTPS certificate, MySQL optimized configuration) check out the UXWizz new server installation guide.

Last updated