make backup – preferably – of two things:
- the database, which is where the configurations and content
- the folder
wp-contentwhere are the plugins, the themes and the files that you have uploaded.
If you have access to phpMyAdmin on your server you can make backups very easily PhpMyAdmin has an Export function that makes a copy of the entire database, a table, whatever you want.
Yes, if your base data is very large then you should use another backup tool, usually available on the server side, if you have access to systems like CPanel or Plesk.
On the other hand, for the more advanced, you can use SSH, which is already I have spoken, and once you control it greatly facilitates backups, and other actions.
To backup with SSH you just have to access with your data (usually FTP data), move in command line to the folder where you want to make backup and, once there, execute this command:
mysqldump -opt -u dbuser -p dbname> dbname.sql
This replaces the dbuser and dbname with yours. Now all that remains is to compress the backup:
gzip -c dbname.sql> dbname.sql.gz
Once this is done, there is less, but you can also do the previous two steps in just one:
mysqldump -opt -u dbuser -p dbname> dbname.sql | gzip> ficheroresultante.sql.gz
Now you have done the backup of the database. If you did the previous steps well you will have it in a zip and in SQL
The next thing is to compress the folder
zip -r wp-content-backup-Dec-3.zip wp-content /
This puts everything in
wp-content inside a zip. The modifier
'- r' is precisely the one we use to "collect" all the subfolders.
Then we can upload the zip to the backup folder, for example:
mv wp-content -backup-Dec-3.zip ../backups
If we do this from time to time, and do not worry about the commands, you can copy them and paste them in the command window, you will have backup of your site safely.