Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Copy site and data to new domain


Go to End
Reply


10 Posts   4096 Views

Avatar
steve_nyhof

Community Member, 224 Posts

21 December 2008 at 10:09am

Is there a way to duplicate a site and database to create a similar site with similar data?

In stead of starting over, I would like to download from the first site, create (restore ?) a database, upload the files and then modify the content. Is this possible?

Avatar
Hamish

Community Member, 712 Posts

21 December 2008 at 8:52pm

=) Well, yes.. if you copy the files and the database to another server then you will have replicated the site.

Although, perhaps you would find the [url=http://open.silverstripe.com/browser/modules/subsites/trunk]subsites[/url] module useful to create multiple sites from the same SilverStripe installation.

Avatar
steve_nyhof

Community Member, 224 Posts

23 December 2008 at 7:10am

Edited: 23/12/2008 7:12am

I understand that the files can copy fine. But I am having trouble importing the database from the first site - has a different user name.

Do I make a database first, install Siverstripe, then import?

Can I restore a database into a new user? If so, what about the install for silverstripe? Or do I not need to install then?

Any guidence as to the steps I would take to do this?

Step 1. Copy all files to new site (user)
Step 2. Make a backup of the database of the first site.
Step 3. ... ???

Thank you,
Steve

Avatar
Hamish

Community Member, 712 Posts

23 December 2008 at 8:41am

If you're having trouble restoring your database with a different username, you probably need to [url=http://www.google.co.nz/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=K6V&q=mysql+restore+database&btnG=Search&meta=]look that up first[/url] - it doesn't have anything to do with SilverStripe.

But this should be whole process start to finish:

1. Create a dump of your database with mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]
2. Copy your SilverStripe files to a new host
3. Modify your mysite/_config.php file with your new database information
4. Restore the database on the new server with mysql -u [username] -p [password] [database_to_restore] < [backupfile]
5. Run /db/build?flush=1 and check for errors.

Avatar
steve_nyhof

Community Member, 224 Posts

23 December 2008 at 8:49am

Thank you, I will give it a try, but before I do, please pardon me for not understanding the code you are using.

mysqldump: Is this something I do from the address or inside phpmyadmin, or what?

Can I do what you are saying inside phpmyadmin?

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]

mysqldump -u [abc] -p [123] [databasename] > [backupfile.sql]

mysqldump -u abc -p 123 databasename > backupfile.sql

Where do I do this?

Avatar
steve_nyhof

Community Member, 224 Posts

23 December 2008 at 8:59am

Edited: 23/12/2008 9:10am

Sorry, I forgot to click on the link you gave - I will go from there - Thank you

Ok, I do not have access to the server Shell as it is a reseller hosting account.

So I will need to use phpmyadmin... Any thoughts on that?

Avatar
Hamish

Community Member, 712 Posts

23 December 2008 at 9:13am

Phpmyadmin Backup: [url]http://php.about.com/od/learnmysql/ss/mysql_backup_3.htm[/url]

PhpMyAdmin Restore: [url]http://php.about.com/od/learnmysql/ss/mysql_backup_4.htm[/url]

Avatar
steve_nyhof

Community Member, 224 Posts

23 December 2008 at 9:38am

Edited: 23/12/2008 9:43am

I got it.

I first made the database like always for SilverStripe
Installed SilverStripe
Uploaded my images files
Uploaded my theme

Export in phpmyadmin from original site...

Uncheck the "Add AUTO_INCREMENT value"
Export type - > REPLACE
Click GO

Import to new site...

Uncheck the Partial import option ??
Click GO

Go to Top