Duplicate Mysql Db Not Backup And Restore
Posted 05 December 2012 - 04:04 PM
I have a site hosted on 1and1 server connected to a DB. I have copied the whole site into a sub directory to make changes to the code. I want to make a new DB with all the same data as my Live site. When I export the data using phpmyadmin and import it just overwrites the existing DB.
Is there a way I can export my DB and then rename it so when I upload it I have two databases?
Thanks in advance.
Posted 05 December 2012 - 04:11 PM
CREATE DATABASE IF NOT EXISTS db_name; USE db_name;
Just enter a new name for the db_name.
You will also need to assign a database user permissions to use that new database.
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.
Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.
Posted 05 December 2012 - 05:22 PM
Instead of copying the files into a subfolder I would advise creating a new top level directory, copy all your files there, and then create a sub-domain for your development environment, e.g. dev.mydomain.com.
If you have any file paths in the PHP or HTML that is relative to the root of the web root or the URL you will run into errors if just running from a sub-folder. But, then again, if your intent is to modify the site to work from sub-folders then you would want to do that.
I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users