How to clone production website to development environment
Hi all,
I tried to clone my production website to my local machine for the purpose of upgrade testing, further feature development, with the database from Production. Once the localhost website is running, I noticed not all the changes I made on production website appear on my local version eg the footer texts are different in partial view, color are missing from master template.
So I thought it just need to be exported like the Document Types.
However, to my surprise the Templates cannot be exported. Imaging the site grows, there will be a lot of labour efforts to copy from production sites to local site.
So how can I back up my site completely without any manual copy and paste?
It is correct that not everything is saved in the database. Templates, partial views and partial view macro's are not saved in the database, they are saved as a file on the filesystem of your hosting environment.
What I can recommend, if you're going to do this more often and you're ok with purchasing a license, is to get uSync complete edition. With uSync complete edition, you can synchronise all your content, templates, media and more between different instances of your website. uSync really makes your life 100x easier, so I can recommend uSync at all times.
If you don't want to purchase a license, then you'll have to do a few manual actions. On a basic Umbraco installation, I can think of two things that are saved on filesystem, but you'll have to fix this case-by-case.
In a basic Umbraco installation, you have look out for these items:
Razor templates, partials and macro's.
Media
Razor templates are all stored in the same folder on your hosting environment: "views". Simply downloading that folder and pasting it in your solution is sufficient, regardless of the amount of templates you have. I'm unaware of any means to store these in a shared environment.
Media items are stored on filesystem by default, but you can choose to host your files on a shared filesystem, like azure blob storage for example. If you're not able to do this, all the media items are stored in a single folder, so once again, this is a single copy/paste, regardless of how many media items you have.
Just to add as much as we would love for you to purchase a copy of uSync.Complete , you don't have to to deploy from dev to production, you can do a lot with the free uSync package.
uSync will write everything (datatypes,doctypes,templates, etc) to disk, when ever a change is made, these changes are then stored in the uSync folder on disk - you can copy this folder to another site and perform an import and all the changes appear in that site.
for deployments you can set it up to run on startup, or use a command line to trigger the import or use the dashboard, to make sure you see what happens.
this has an added bonus of putting everything in source control.
as Denis says, you will still need to copy the razor stuff and media (views and wwwroot folders normally. - but then combined with the usync folder everything 'just' works.
Complete is a package on top of this core (&free) functionality that lets you push and pull between servers, create snapshots (point in time changes) and partial export/imports - We obviously think all of this is cool, but you don't need it to perform the basics of moving a site from a to b.
How to clone production website to development environment
Hi all,
I tried to clone my production website to my local machine for the purpose of upgrade testing, further feature development, with the database from Production. Once the localhost website is running, I noticed not all the changes I made on production website appear on my local version eg the footer texts are different in partial view, color are missing from master template. So I thought it just need to be exported like the Document Types. However, to my surprise the Templates cannot be exported. Imaging the site grows, there will be a lot of labour efforts to copy from production sites to local site.
So how can I back up my site completely without any manual copy and paste?
Hi Max!
It is correct that not everything is saved in the database. Templates, partial views and partial view macro's are not saved in the database, they are saved as a file on the filesystem of your hosting environment.
What I can recommend, if you're going to do this more often and you're ok with purchasing a license, is to get uSync complete edition. With uSync complete edition, you can synchronise all your content, templates, media and more between different instances of your website. uSync really makes your life 100x easier, so I can recommend uSync at all times.
If you don't want to purchase a license, then you'll have to do a few manual actions. On a basic Umbraco installation, I can think of two things that are saved on filesystem, but you'll have to fix this case-by-case.
In a basic Umbraco installation, you have look out for these items:
Razor templates are all stored in the same folder on your hosting environment: "views". Simply downloading that folder and pasting it in your solution is sufficient, regardless of the amount of templates you have. I'm unaware of any means to store these in a shared environment.
Media items are stored on filesystem by default, but you can choose to host your files on a shared filesystem, like azure blob storage for example. If you're not able to do this, all the media items are stored in a single folder, so once again, this is a single copy/paste, regardless of how many media items you have.
I hope this was helpful to you.
Kind regards, Dennis
Hi Max,
Just to add as much as we would love for you to purchase a copy of uSync.Complete , you don't have to to deploy from dev to production, you can do a lot with the free uSync package.
uSync will write everything (datatypes,doctypes,templates, etc) to disk, when ever a change is made, these changes are then stored in the uSync folder on disk - you can copy this folder to another site and perform an import and all the changes appear in that site.
for deployments you can set it up to run on startup, or use a command line to trigger the import or use the dashboard, to make sure you see what happens.
this has an added bonus of putting everything in source control.
as Denis says, you will still need to copy the razor stuff and media (views and
wwwroot
folders normally. - but then combined with the usync folder everything 'just' works.Complete is a package on top of this core (&free) functionality that lets you push and pull between servers, create snapshots (point in time changes) and partial export/imports - We obviously think all of this is cool, but you don't need it to perform the basics of moving a site from a to b.
Kevin
Thank you so, so much Dennis & Kevin,
I will give it a go and see how much I can take before it becomes too much of a hassle.
Regards,
is working on a reply...