954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Uploading current php site to another site.

Happy New Year To You All !

I have a php site and would like to upload the same site onto another domain name, while keeping the current site also in it's current domain name.

Does anyone know how I can upload the database - mysql - and duplicate the site ???

Thank you :)

New Girl.

new_girl
Newbie Poster
5 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

Use mysqldump to create a backup of the database and use mysqlimport to read it into the new database.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

As long as you didn't refer to the absolute URL in the code, all you should need to do is copy the database over.

If you want to use the same database, you can set the server in your MySQL connect statement to the other host. That's how I handle my test environment and test database.

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

FYI, if you are trying to have two different sites available to the public this is a bad idea as Google will hit you with a duplicate content penalty of some sort.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

If you have 1 site and 2 domain names why not just add the other domain as a 'addon domain' to the server and you can access that 1 copy from both url's

If you want to copy the site to another server then generate a full back-up with mysql-grabs upload the mysql-dump and scripts at the neew server. the only thing you will need to then change/re-create will be the database name and user.


[PHP]$db = mysql_connect("localhost", "USERNAME", "PASSWORD") or Die("No connection establish to database: " . mysql_error());


mysql_select_db("DATABASENAME") or Die("DB Error !");[/PHP]


Hope this helps.

loopylouis
Newbie Poster
9 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You