Skip to main content

How to tar.tgz your local drupal 8 testing website

Now that "drush ard" is dead i was looking for a "compact - light" solution through the terminal. This is what i came up with, in order to dump archive the minimum amount of files and directories.

tar -zcf --exclude="vendor" --exclude="web/core" --exclude="web/modules/contrib" --exclude="web/modules/themes/custom/d8custom_theme/node_modules" -f d8localdev.25112020.tgz d8localdev 

where d8local is your /Users/pixelthis/www/d8local directory if you are using a default mamp installation for example. and d8custom_theme/node_modules is for excluding the npm packages in case your are using a theme that works with webpack.js or gulp etc. So in case you need to raise your localdev from the deads untar like this

tar -zxvf d8local.25112020.tgzz 

For Mac OSX I had to do

 tar -zcv --exclude='folder' -f theOutputTarFile.tar folderToTar

Note the -f after the --exclude=

terminal shell unix