0

So I built the D7 site on one server and then moved it to other server and I noticed that .sql size is 8MB in total. I then exported .sql without any cache tables, including cache_* files like cache_block, cache_views and etc. I skipped all tables starting with cache_ and the total .sql size was below 2MB!

So when moving site from one server to other do I need to include cache tables when exporting the .sql or not? Because looks like those cache tables takes 80% of .sql size. And as I understand cache is something temporal?

I came up with this question after moving site to new server and I noticed that tmp folder has 100% copies of images that I uploaded to nodes, but those original images are held in separate files/ folder. So now I got those original images 50MB and copies of those images in tmp/ dir and its also 50MB. So I get extra 50MB taken. I was thinking maybe its because I moved the site with all caches without running cron and etc. and maybe somehow those images in the tmp dir got lost and forgotten by Drupal system or something? I now removed those from tmp dir and it seems to be all working fine.

Strange, can't really understand that.

2

You can typically skip the data in all of the cache tables. That is temporary data that Drupal will recreate when as needed. Basically, the cache tables store data the Drupal creates so that it doesn't need to create it the next time.

You can also usually skip the data in the watchdog table if you don't need the system logs. Depending on your situation, you may also be able to skip sessions.

There are a few others you can skip (like flood), but they don't usually don't have much data in them in most situations.

Just remember that you want to back up the table structure (ie, the CREATE statements) and just skip the data.

The Backup and Migrate will take care of most of this for you. drush sql-dump can skip table, data too.

Normally, I just transfer everything when moving between servers. I just clear cache as part of the restoration process. I would rather have a bigger file than have the chance of missing something.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.