To think about a backup
Posted by: egoph (---.bredband.comhem.se)
Date: June 19, 2016 02:56PM

When I do a backup mith phpmyadmin and a sql file what to think about.

If I have made a virtual host in websettings or an "add local host" and then make a backup.
What to think about or do I have to do some changes before or after?

Options: ReplyQuote
Re: To think about a backup
Posted by: Otomatic (Moderator)
Date: June 19, 2016 03:11PM

Hi,

I didn't understand what is the problem!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: To think about a backup
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 20, 2016 12:48AM

I also don't fully understand your questions except that it has something to do with backing up databases.


In general -

When to backup -

- before you make structural changes to a DB or a DB Table.

- depending upon the volume of changes to data in the DB, you should backup up at regular intervals (days, weeks, etc. - maybe hours for a very busy database)

- there really is no wrong time to make backups. Better to have two many that not enough. You can always delete old backups when you no longer need them.

Backups give you a way to get back to a know state of things when something goes wrong. Without database backups (or programs and data backups) you can find yourself without any way to restore things to the way they were.

You might be able to recover by installing or recreating programs, databases, and data files manually, but how long would that take and what data would you have lost?

When to backup depends upon how safe you want to be as regards the functionality and timeliness of your data if you have to recover from a problem. If you computer "crashes" any backups on it will be lost, so copy backups to CDs occasionally and you'll have them where they are still accessible if you lose your HDD or something else happens to make the computer unusable.

Adding a virtual host does not make any changes to any MySQL databases and a backup is not needed after making a virtual host.

Are you asking how to make a virtual host in WAMP? If so, tell me and I'll give you full instructions for making one if you are using WAMP 3 - WAMP 3 has an automated way to create virtual hosts, earlier versions did not and you had to modify some files manually.

There are at least two ways to backup a MySQL database.

1 - Use phpMyAdmin and do an Export on the database. Select the database in phpMySQL. A row of buttons will be displayed across the top in the right hand panel. There is an Export button. Use it to export the database to a file on your computer.

2 - Make an actual copy of the database file located in the datadir of MySQL. "datadir" is a setting in the MySQL configuration settting and on my WAMP system, it is actually the C:\wamp64\bin\mysql\mysql5.7.11\data directory.

I would use method number 1 - Export the database to a directory on your computer, outside of WAMP. As you should be making duplicate backups so that you can restore to different points, as needed, you will have to change the name of the export file when you do an Export.

I have a database named justblog. When I export it, phpMyAdmin wants to use the file name justblog.sql

If I were making a backup right now, I would change the file name to justblog201606191756.sql

The 20160619 is the date June 19, 2016

The 1756 is the time, 5:56 pm

That will allow you to keep previous exports as additional backups and you can tell from the file name exactly when you created it - you could even add some text to the name to tell you why you made the backup. For instance:

justblog201606191756BeforeMakingMajorChangesToUserTable.sql

I would not just copy files out of the MySQL data directory because something might change in a future release that would make the copied files invalid.

When you Export a database, as SQL, the file will contain the SQL statements to recreate the database. It would work on any newer release of MySQL. Do an export and look at the contents of the file.

If I have not answered your questions fully, please post again.

I am guessing you are using English as a second language but please try and word things so that we can get an idea of what you are saying.

If you are not a native English speaker, you are doing much better than I can - English is the only language I know, other than just a very little bit of some Spanish I studied in school.

I could say "Hello, how are you? In Spanish but I might not be able to understand the full reply :-)

Options: ReplyQuote


Sorry, only registered users may post in this forum.