5. Set up databases
If your web sites are all static HTML then you can skip this section, but modern sites often have at least some database-driven content and many are totally dynamic. For such sites backing up the files would be futile - most of the important data is in a database.
Here we set up ClonePanel with the information needed to backup all databases.
Important - ClonePanel stores a username and password able to access each database. CPanel permits you to use the main account username and password, or even the reseller password to access databases - YOU MUST NOT USE THESE HERE. ALWAYS CREATE A DATABASE USER TO ACCESS THE DATABASE(S) AND ENTER THAT INFORMATION HERE.
This is because the information collected here will be stored on the remote account, because that’s where the database will be dumped or restored. As such the way the database login is stored is no more of a risk than using any application’s standard config file - which also must never contain the account password for the same reason. A future version of ClonePanel could perhaps use remote access to MySQL via a secure tunnel.
If you’re following this in sequence then it will come as no surprise that the command to add a database is "./database add".
[tester@ACER scripts]$ ./database add
ClonePanel version 0.30, Copyright (C)2006 Chris Cheers
ClonePanel comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute
it under certain conditions; read LICENSE.txt for details.
Enter CPanel account username: clonepan
Enter full database name: clonepan_wp
Enter database username [clonepan_wp]:
Enter database password: secret
Enter database tables (default blank):
Enter database hostname (default blank):
Creating ./../accounts/clonepan/databases/1
Changes made must be synchronised with remote host(s)
Run sync program now? (y/n): y
ClonePanel version 0.30, Copyright (C)2006 Chris Cheers
ClonePanel comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute
it under certain conditions; read LICENSE.txt for details.
stdin: is not a tty
building file list … done
colours
databases/
databases/1
error_codes
rconfig
roles
scripts/
scripts/includes
scripts/moveallmail.pl
scripts/post_process
scripts/pre_process
zones/
sent 663 bytes received 332 bytes 663.33 bytes/sec
total size is 16942 speedup is 17.03
Sync complete for clonepan (clonepan) on KATE
Add database done!
[tester@ACER scripts]$ ./sync -u clonepan
After adding a database you must sync the ClonePanel data with the remote account(s). This can be done manually with "./sync_remote" or by answering "y" when prompted. If you want to add more than one database then you only need to sync data after defining the last one.
At this point (finally!) the basic setup is done and we’re ready to back-up the web site.