Prerequisites
- Lightweight cloud creates images and shares them
- Create a cloud server instance through the image created by the lightweight cloud
- Create another image for the cloud server created under this image.
- Create a new bucket as a storage object for image export
- Download the backed up image through the bucket
- Import to PVE
Get start
- Create an image for the erpnext host in the lightweight cloud
- Enable sharing of the image in the region of the instance
- Create a cloud server in this region (cloud server - non-lightweight cloud) and select this image
- After activation, wait for startup and confirm that the service is normal
- Stop the instance and create an image on the current instance (cloud server - not lightweight cloud)
- Wait for the image to be created
- Come to object storage-bucket list-create bucket
- Return to the image in the cloud service and select the image created in step 5.
- Select image export in the image options
- Select the QCOW2 format when exporting. After the export is completed, it will be stored in the bucket.
- Return to object storage - select the bucket list - find the image you just exported - select download image
- Download the exported image locally and then import it into PVE.
PVE Import
- USB Disk mount
- Import
qcow2to vm - Config VM
lsblk
mkdir -p /mnt/usb
mount /dev/sdb1 /mnt/usb
ls /mnt/usb/iso/*.qcow2
## import to vm - qm importdisk <源文件路径> <目标存储ID>
qm importdisk 101 /mnt/usb/iso/vps-backup.qcow2 local-lvmReturn to the PVE interface, add the imported disk to the created empty vm, and set the startup disk.
ERP Next Backup and Restore
Restore
- Switch to ERPNext user
- Configure backup path, which is in the
sites/erpnext/private/backupdirectory by default - Download the backup data of the source server to the new server
- Enter
frappe-benchto restore
bench restore 20251231_180001-erpnext-database.sql.gz
//输入mysql root 的密码
//等待3-5 分钟, 就会提示 site ***** has been restored 在前端刷新ui 即可看到新的数据MySQL change root password
- Exit ERPNext user
- switch to root
- Use root to enter MySQL
- Modify the root password through
ALTER USER
-- 使用 sudo 以系统管理员身份直接登入 MySQL
sudo mysql -u root
-- 切换到 mysql 库
USE mysql;
-- MariaDB 10.4+:启用密码认证并设置新密码
ALTER USER 'root'@'localhost'
IDENTIFIED VIA mysql_native_password
USING PASSWORD('你的新密码123');
-- 刷新权限并退出
FLUSH PRIVILEGES;
EXIT;Backup
- Just enter frappe-bench and perform backup.
- Check backup files
cd frappe-bench
bench backup
ls sites/itiohub.com/private/backupsReference
Tencent Cloud Server Offline Migration https://cloud.tencent.com/document/product/213/19233
How to backup and restore in Erpnext https://www.youtube.com/watch?v=3qSnwLJmgmg