Moving a site.
- Take
bench --site {site-name} backup --with-files
on the running setup. - Copy files from
sites/{site-name}/private/backups
to new server and optionally stop old server so users don’t create new data. - In case of container setup copy files from server into container using
docker cp
or placing files in volume location. - Enter any worker container and create site using
bench new-site --no-mariadb-socket
command. Name the site as per configured domain name. (Note down thedb_name
fromsite_config.json
created) - Enter mariadb container / use mysql client and execute
drop database {db_name}; create database {db_name}
. This will clean the site db that was created by new site. We do this so that we have a running site configured without any database resulting inInternal Server Error
. - In mysql shell execute,
use {db_name}; source /path/to/database.sql
. This will restore the database from backup on fresh db. We usesource
from mysql shell as it re-connects in case of disconnection or timeout during restoration of huge database. Simple alternate command will bemysql -uroot -p{root-password} -h{hostname} {db_name} < /path/to/database.sql
- Copy additional keys and encryption_key from backed up site_config.json. (Note, DO NOT change the db_name, db_password keys from newly created site, only copy other keys from backup site_config)