Backup Your OpenSim Server
Before proceeding with the backup, ensure that your OpenSim server is not running. This prevents data corruption during the backup process.
Use the following command to check for processes running with mono
or dotnet
:
ps aux | grep -E 'mono|dotnet'
If the output is similar to the example below, your OpenSim server is not running, and you are safe to proceed:
ludo@sheikah:~/opensim/bin$ ps aux | grep -E 'mono|dotnet'
ludo 1255 0.0 0.0 4088 2048 pts/0 S+ 18:45 0:00 grep --color=auto -E mono|dotnet
If you followed my previous guide on “Install OpenSim 0.9.X.X in Grid Mode on Ubuntu 24.04”, your OpenSim server files should be in the home directory (~/
) and named HG
or opensim
.
Run the following commands to create a compressed backup of your OpenSim server files:
cd ~
tar -cvf - ~/opensim | gzip -9 > opensim.tar.gz
Dump and compress the Database: Replace opensim
with your database name if it is different:
sudo mysqldump -u root -p opensim > ~/opensim.sql
tar -cvf - opensim.sql | gzip -9 > opensim.sql.tar.gz
After completing the steps:
– opensim.tar.gz
: Contains your server files.
– opensim.sql.tar.gz
: Contains your database backup.
Keep these files in a secure location, such as an external drive or cloud storage.
Restore Your OpenSim Backup
Follow these steps to restore your OpenSim server and database from backups. Make sure your OpenSim server is not running during the restoration process.
Ensure you have the following backup files:
– opensim.tar.gz
: The compressed backup of your server files.
– opensim.sql.tar.gz
: The compressed backup of your database dump.
Place these files in the home directory (~/
) or adjust the commands if they are stored elsewhere.
cd ~
Extract the Server Backup:
(This restores the opensim
directory in your home directory.)
tar -xzvf opensim.tar.gz
Extract and restore the Database Backup:
tar -xzvf opensim.sql.tar.gz
mysql -u root -p opensim < ~/opensim.sql
Now you can cleanup the leftover and start your server:
rm ~/opensim.tar.gz
rm ~/opensim.sql.tar.gz
rm ~/opensim.sql
Leave a Reply