Transfer a site from one server to another server - ashish-greycube/help GitHub Wiki
Steps to transfer site :
In Server_1
1] Check apps which are installed in site and note their versions
2] Take full backup of site (database file, private file, public file, .json file)
bench --site [site_name] backup --with-files
3] Create A record for new-site
4] Transfer all backup files in another server using SFTP
--> Go to /site/[site_name]/private/backups/
bench/site/[site_name]/private/backups$ sftp user@ip(server_2)
> cd home/frappe/frappe-bench
> put [database_file_name]
> put [private_file_name]
> put [public_file_name]
> put [json_file_name]
In Server_2
1] Get all apps in bench which are installed in dump
bench get-app [app_url] --branch [app_branch]
2] Create new-site
3] Generate SSL certificate for new-site
4] restore all backup file in site
bench --site [site_name] restore [path of database file] --with-private-files [private file path name] --with-public-files [public file path name]
4] Migrate site
bench --site [site_name] migrate
In Server_1
drop-site
bench drop-site [site_name] --no-backup
Delete SSl certificate of dropped site
sudo certbot delete --cert-name [site_name]
take backup of nginx file and run
bench setup nginx