Jump to content

[SOLVED] Do I need to migrate site/assets to production, or just site/templates?


Boost
 Share

Recommended Posts

Hi,

I recently realised that all of my files are located under /site/templates. I don't have anything in /site/assets. So I'm curious what that folder is for. I'm asking because I'm unsure whether I need to copy /site/assets to the production server during the migration. To put it another way, should I move the entire /site or only the /site/templates?

Thanks 

Link to comment
Share on other sites

10 hours ago, Boost said:

I don't have anything in /site/assets. So I'm curious what that folder is for.

Most of the contents in site/assets are created on the fly like caches, compiled template files and log files, and therefore don't need to be transferred. The exception are page files (file and image fields), which live under site/assets/files, so you need to copy that directory too. The things that need to be copied to move a complete site to another server are

  • site/templates
  • site/modules
  • site/assets/files [*]
  • site/classes (if the site uses custom page classes)
  • site/init.php (if used)
  • site/ready.php (if used)
  • site/finished.php (if used)
  • Then any settings in site/config.php need to be adapted in the target site (including $config->userAuthSalt, which needs to match the database contents)
  • sites/assets/cache should be emptied

[*] If you've only done a visual overhaul to an existing site without changing any contents, you don't need to copy the files directory.

If you don't have any content on the target site you need to preserve, you can of course also copy the whole site directory, empty the site/assets/cache directory and adapt the settings in site/config.php. In that case, you just need to pay attention that directory permissions under site/assets are correct so the webserver user has write permissions. That last point is often overlooked when uploading stuff using (s)ftp or zip files.

  • Like 3
Link to comment
Share on other sites

  • Boost changed the title to [SOLVED] Do I need to migrate site/assets to production, or just site/templates?
On 9/9/2023 at 7:37 AM, BitPoet said:

If you don't have any content on the target site you need to preserve, you can of course also copy the whole site directory

Hei @BitPoet, I apologize for reviving this thread, but I have a quick question. Since I don't need to keep any data on my remote server, I moved the entire /site directory along with the database. However, things didn't go as planned. I suspect that the culprit is the $config->userAuthSalt. So, my question is, should I change/update the $config->userAuthSalt every time I export my database from my local development environment and import it into my remote server, or is it something I only need to do the first time I perform the import on my remote server?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...