Backup Database Server2Go while developing.

When you are developing with the Server2Go stack, you might want to automatically backup your database periodicly.
 
I propose a simple script that backups your database each time when you start up your Self configuring database.

Script:

@echo off

rem Add date to filename
for /f "tokens=2" %%i in ('date /t') do set DATE_DOWNL=%%i
for /f "tokens=1,2 delims=:" %%i in ('time /t') do set DATE_DOWNL=%DATE_DOWNL%_%%i%%j

echo dumping database to MySql_%DATE_DOWNL%.sql

.\server\mysql\bin\mysqldump --port=7188 -u root --all-databases >.\MySql_%DATE_DOWNL%.sql

 
Create a batch file with a name such as “backup.cmd” and place it in the same location where “server2go.exe” is located.
 
You will need to place it in your pms_config.ini :

[Startup]
;--- You can add additional EXE files that will be started in the startup process of Server2Go
;--- At the moment the EXE files will be started invisible and right AFTER the webserver
;--- and MySQL-Start
Startup1=backup.cmd
Startup2=
Startup3=

 
So every time you start Server2Go a backup will be made. Also as long Server2Go is running you can execute the batch file whenever you want to make an additional extra backup.

Please +1 When you are using it!

Leave a Reply