DizmalBlog


24
Feb

Bacup Road

There is a road near Todmorden called Bacup Road. I used to believe that this road lead everywhere. When I was a child growing up in my North West Manchester town and I asked an adult for directions they often sent me ‘bacup road…’

So after a poor link line I will now get on with the actual content of Ta Ta Tadaaa…. Backing Up Our Data, lights flicker, in the distance a dog barks, pan to eerie face briefly illuminated by moonlight. Anyway, this will consist of backing up:

  • The Photographs.
  • The Photograph Gallery .
  • The SQL Databases
    • FrownyBaby
    • DizmalBlog
    • Wiki

So, photo’s and gallery first. This is simply a matter of archiving the directories onto a DVD. I create a tempry directory with symlinks to the base of all the directory tree’s I want to include and use the mkisofs option to follow symlinks.

e.g.

mkdir tmp; cd tmp
ln -s /media/photos; …
growisofs -Z /dev/dvdrw -J -R -f .

To append more data use the -M option rather than -Z

Alternatively I could just use Nautilus but that would be dull ;-)

Next comes the databases. I have little interest in databases. Everytime I try and learn enough about them to get around I start to dribble and then get distracted. So, in order to combat this I am going to document to myself enough information to get around and backup the data. I know this is going to be easy but I always forget everything I try to learn about databases.

So, first of all I am using MySQL as all developers support this one so all Web based information storage sites are based around it. So, what users have I created whilst installing the blogs and wiki sites?

mysql -u root -p –database=mysql
select user, host from user;

Okay I seem to have more users than I need but then thats because i didn’t know what I was doing. Anyway, three of them are regularly used. So, looking around the most obvious way that bounces straight out would be to use mysqldump to dump all databases as the root user. This would dump all tables (which would included the user account tables) in a format ready to import into another SQL database. Brilliant.

mysqldump -u root -p –all-databases > .sql

To import this data back into the database should just be

mysql < .sql

Leave a Reply

DizmalBlog is is proudly powered by Wordpress
Navigation Theme by GPS Gazette