Jump to:

4873 Posts in 7242 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Copy site and data to new domain

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

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

Page: 1 2
Go to End
Author Topic: 3598 Views
  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Copy site and data to new domain Link to this post

    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?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Copy site and data to new domain Link to this post

    =) 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 subsites module useful to create multiple sites from the same SilverStripe installation.

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Copy site and data to new domain Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Copy site and data to new domain Link to this post

    If you're having trouble restoring your database with a different username, you probably need to look that up first - 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.

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Copy site and data to new domain Link to this post

    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?

  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Copy site and data to new domain Link to this post

    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?

  • Hamish
    Avatar
    Community Member
    712 Posts
  • steve_nyhof
    Avatar
    Community Member
    224 Posts

    Re: Copy site and data to new domain Link to this post

    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

    3598 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.