Transferring a site between hosts

Silverstripe Version: 5

**Question:**Can I easily Transferring a site between hosts

Long time WordPress user. Thinking about trying SilverStripe.
I have scanned the Docs and find no references to “Migrate”, “Backup-Restore”, “Sandbox”, “Transfer” that would allow me to build a site on Windows with a WAMP stack, then transfer it to a 3rd party hosting account. I realise it would involve backup/restore of DB and of files and directories, then some config setting…
Or
Is it better to develop online at hosted site, but keep pages private until ready for publishing?

Thanks for any input…

// Include any relevant code. If you have a lot of code, link to a gist instead.

This is one of the tradeoffs between SilverStripe and WordPress (i.e. the typical convenience/security tradeoff).

On one hand, WP offers lots of extra functionality like a point-and-click (integrated) backup/restore capability, not just DB but also the actual application files, templates, plugins and etc. The downside of that is security; i.e. the CMS’s ability to edit its own files as a feature (and the necessity to structure your permissions that way).

On the other hand, with SilverStripe, the files that are responsible for actually running/operating your website must be maintained by you, a developer or similar. The database is manually backed up and restored as well (e.g. via phpMyAdmin or via the mysql command line). In a way, that’s a major advantage from a security perspective because access to inject malicious long-lived code is much more limited. So, it’s not as convenient. The only gray area there is security updates; SS still requires manual updates to apply security fixes. To be fair, you may not need to update as frequently, either (it all really depends).

One of the other reasons I specifically chose SilverStripe were the built-in features, particularly the site tree functionality. That as well as that tradeoff mentioned above. It’s a major feature for me to have such direct control over the code and functionality, particularly the way data is stored, how it’s managed in the CMS (a huge bonus over WP) and how it’s maintained in the long term, since it’s not fully DB driven or hidden behind a plugin.

Back to your original question: Transferring SilverStripe sites between hosts. No, it’s not as easy as Wordpress, not really. But, it’s not that hard either. You just need to get your SS install setup on the new host with 1. all the same files (however you set it up in the other house) and then 2. manually import your assets and 3. your database. Naturally there are fiddly tidbits in there (like DB config details and stuff).

Many thanks for those details @chunk_split.
I don’t see the three steps you outline for migrating a site as being too difficult. And I see the benefits security wise of not being able to more fully automate the process.

I am comfortable using phpmyadmin so will forge ahead and trial SilverStripe. So far I like what I see.
Thanks.

Provided you have SSH access, you can automate everything without sacrificing your security: just don’t use the web user in your scripts.

For instance, for the “Transfer” part, I use deployer with a variant of this script. Then I can push modified code to the host with a single command (dep deploy <host>) or pull assets and SQL data from the host (dep backup <host>). At the end the web user has only read access to public and write access to public/assets. And each host has its own environment file (.env.<host>).

There are many other ways to automate this stuff, including rolling out your own solution. But I agree with @chunk_split: using the backend to do these tasks is just actively looking for problems.