Exporting/Copying/Backing-up User database
OK, did some looking around, but can't seem to find any definitive answers.
What I want to do is back up my existing user/faction databases, wipe my server clean, start it up fresh, restore my databases, and continue without any troubles.
While I have seen this asked before, the answer is usually along the lines of "copy the uniquename database and backup your SQL database". While for some people, that may very well be enough of a description to perform the task, I'm going to need a little bit more help than that. :mellow:
I can understand basically copying out the "uniquenamed" folder and copying it back in with the proper permissions. That's pretty simple and straightforward.
Where is the SQL database stored? How do I retrieve it? What is the easiest method for doing this? (Note: I tried once using MySQL to export the database information and then later import it back in. This failed horribly. I need something reliable, and to me that would seem to be simply copying the database files out off of the server. I just don't know where the hell they are.)
Basically I have to completely re-install a different version of Linux, figure I'll upgrade my server from 1.4.4 while I am at it, and I don't want to lose all my friends accounts and characters. :/:
Re: Exporting/Copying/Backing-up User database
Quote:
Where is the SQL database stored
no linux / db skills but u will development a pw server based on linux > a ur sure ?
Re: Exporting/Copying/Backing-up User database
Actually, you do not need to back up the uniquename DB (at least not for basic functionality you do not)... You DO need to back up the game DB and SQL DB...
Re: Exporting/Copying/Backing-up User database
Try using phpmyadmin for your mysql database.
Re: Exporting/Copying/Backing-up User database
I would recommend just using mysqldump <.<
Re: Exporting/Copying/Backing-up User database
Yeah, mysqldump works too. Depends how familiar the OP is with linux atm. If the OP is just starting out and not so familiar with using a command-line interface, phpmyadmin can be a good graphical alternative for more than just getting a sql dump. Whatever floats his boat.
Either way, try
apt-get install phpmyadmin
or
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
Re: Exporting/Copying/Backing-up User database
btw mysqldump is the best way to backup db over 30 sec delay in phpmyadmin . i cant explain this . my main lang is german . so other can do this im sure ...
Re: Exporting/Copying/Backing-up User database
#!/bin/sh
dir=/backup
##mysql
date=`date '+%H.%M-%d.%m.%Y'`
name=mysql
host=localhost
dbname_list=`mysql -h $host -Bse 'show databases' \
| grep -v test | grep -v information_schema`
for dbname in $dbname_list; do
echo $dbname
/usr/local/bin/mysqldump -h$host $dbname \
| /usr/bin/gzip >> $dir/$name/$name-$dbname-$date.gz
rm $dir/$name/last-$name-$dbname.gz
ln -s $dir/$name/$name-$dbname-$date.gz $dir/$name/last-$name-$dbname.gz
done
Re: Exporting/Copying/Backing-up User database
Here's mine :
TIMESTAMP=`date +%s`
mkdir -p /home/backups/$TIMESTAMP/databases/
cp -R /home/PWServer/databases/ /home/backups/$TIMESTAMP/databases/
mysqldump -u pwa -pxxx--verbose --routines site > /home/backups/$TIMESTAMP/site.sql
mysqldump -u pwa -pxxx--verbose --routines server > /home/backups/$TIMESTAMP/server.sql
mysqldump -u pwa -pxxx--verbose --routines forum > /home/backups/$TIMESTAMP/forum.sql
mysqldump -u pwa -pxxx--verbose --routines mail > /home/backups/$TIMESTAMP/mail.sql
mysqldump -u pwa -pxxx--verbose --routines pwelements > /home/backups/$TIMESTAMP/pwelements.sql
mysqldump -u pwa -pxxx cpw > /home/backups/$TIMESTAMP/cpw.sql
tar -cjvf /home/backups/"$TIMESTAMP"_compressed.tar.bz2 /home/backups/$TIMESTAMP/
rm -rf /home/backups/$TIMESTAMP/