Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

How Do I Restore A Backup?

Quote Reply
How Do I Restore A Backup?
Hi,

I donno what my host did, but all my MySQL tables were deleted (bastards! Wink) - I have the backups, and have restored the tables, but want to load the old data back, anyone know how to do this?

Thanks!

------------------
Michael Bray
....
Review your webhost, or find a new one at http://www.webhostarea.com


Quote Reply
Re: How Do I Restore A Backup? In reply to
OK,

I have been reading through the forum and found out to do this you need to go to the import data and type in the path to the backup with everything deleted.

I have done this and I get the error

Quote:
Could not parse header row: ''.

I know Perl, and don't have a clue with MySQL at the moment... so can someone who knows what that means please help me - please! Smile

------------------
Michael Bray
....
Review your webhost, or find a new one at http://www.webhostarea.com


Quote Reply
Re: How Do I Restore A Backup? In reply to
Just so that you know,

I did fix this my self for my site, but on the default Links SQL 1.11 you cannot import a back up.
Quote Reply
Re: How Do I Restore A Backup? In reply to
I found out what the problem was.

I was using the default 'test' database that came with MySQL. Apparently this has some restrictions.

Anyway, I finally decided to move outta the test database cause I was happy with Links SQL - and I was able to easily import the data.

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------




Quote Reply
Re: How Do I Restore A Backup? In reply to
I'm still catching up on things... Sorry you had to bang around on this...

Instead of import, check out the FAQ and the threads on using the "insert" command to move data from one table to another (even between databases) and the LOAD command to insert text-file (back up files) into the database.

If you have your own server, and access to the mysql subdirectory, and data directory, you can make a copy, or backup, of the database by simply copying the files to a new subdirectory. MySQL will find the files,even without a restart, the next time a request for that database is made.

It's really easy to make databases, use them, and then get rid of them when you want to.

To erase a database, you just delete the subdirectory (or you could go through MySQL interface.

This is a nice feature of MySQL over the larger transaction-based DBMS like Oracle.
To play with their "database" systems you have to do a lot of work, or consume massive CPU and system resources.

With MySQL the same things are essentially a cp -R * command...

When you create a database, it's really a subdirectory in the ..../mysql/data/ directory. Each table is a set of 3 files.

Don't misunderstand, MySQL keeps a lot of tables and files "open" in memory, meaning the data in the files may not be the most current copy, but the data in the files is a complete "snapshot" of the system at a certain point in time.

Because MySQL is compiled for each system, there's no guarantee the raw data files are transportable from system to system, but you _can_ copy from

..../mysql/data/dir1 to ..../mysql/data/dir2

and request the database "dir2" and it will now exist as an exact copy of the "dir1" database as of the moment you made the copy.

Because this is all on Unix, and seems so complex with the command line interface, it's easy to miss out on how simple MySQL is, and was designed to be.

It was built after the other systems, to fill a need, and to avoid some of the problems the other systems got backed into and had to work around (in order to maintain compatibility)

The MySQL MSQL book is _really_ a worth while investment. You will find yourself using it again and again to get data out of the databases without going through Links (mostly for special reasons -- curiousity, back ups, expansions, etc)









------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/








Quote Reply
Re: How Do I Restore A Backup? In reply to
I agree with you that the MySQL & mSQL is a good book. I got another book today "Writing Apache Modules in Perl and C++" - Which is alright as well - It doesn't to a good job explaining stuff, but most people that have a fair knowledge of Perl and *nix can keep up Smile

------------------
Michael Bray
Review your webhost or find a new one.
www.webhostarea.com
Links SQL User
------------------




Quote Reply
Re: How Do I Restore A Backup? In reply to
Apache the definitive guide is a good one. It has an explanation of all the apache feaures, flags, options, etc, and the copy I have is the second edition valid through 1.3.3, and apache is up to 1.3.11 now, so it's still pretty current.

I got the writing modules book, but I don't write many modules.. Smile It is helpful for code examples and how people do things.

The other good one is the "Mastering Regular Expressions" book. almost essential for working in perl.



------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/