# Release Launch

By
Fernando Cesar

# Connect to EC2 Instance

ssh -i access-key.pem user@ip

This command will connect you to the EC2 instance, and you need to run it in the same directory as the access key (or provide the absolute path to the key). After connecting to the instance, you'll run the commands below.

# First compress

sudo tar -cvf wordpress.tar /var/www/html/

After running this command, everything inside /var/www/html will be compacted into a file named "wordpress.tar", which will be compressed (again) later. The -cvf flags stand for create, verbose, and file, respectively.

# Backup the database

sudo mysqldump -u root --databases --column-statistics=0 wp effefmph_tool zerogtcm_bt_buildability -h {aws-rds-host} | gzip > db.sql.gz

This command creates a backup of the database. After running this command, it’s going to ask for the database password.

# Second compress

sudo gzip wordpress.tar

In this command, we're compressing wordpress.tar again to make it as small as possible and reduce AWS resource costs. After it's done, wordpress.tar will be renamed to wordpress.tar.gz which is the file we'll upload to AWS.

# Sending to AWS

sudo aws s3 cp wordpress.tar.gz s3://your-s3-bucket --metadata "version-id=x.y.z"

Here we're sending the wordpress.tar.gz file to our s3 bucket, The flag --metadate adds metadates in the object. Don't forget to change "s3://your-s3-bucket" to the real s3 host.

sudo aws s3 cp db.sql.gz s3://your-s3-bucket --metadata "version-id=x.y.z"

The last step is to send the database to our s3 bucket. The flag --metadate adds metadates in the object..Don't forget to change "s3://your-s3-bucket" to the real s3 host.

# Done

After completing all the steps, you can set the patch x.y.z as successfully registered today at 12:00 AM (GMT-03).