-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathchallenge_7_Lab.sh
54 lines (36 loc) · 1.24 KB
/
challenge_7_Lab.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Autor: CaothicPechan --- https://github.com/CaothicPechan
# Last update: 02/04/2019
# This is a help for the people who are solving
# Qwiklabs GCP Architecture Challenge
# Migrate a MySQL Database to Google Cloud SQL
# https://google.qwiklabs.com/focuses/1740?parent=catalog
# Your challenge is to migrate the database to Google Cloud SQL
# and then reconfigure the application so that it no longer relies
# on the local MySQL database.
###############################################################
# Go to Cloud SQL
# Create new instance
# Create new User
# user: blogadmin
# pass: Password1*
# Create new Database "wordpress"
# create database [NAME]
# Go to connections tabs
# Create a new Network rule, allow [BLOG_IP]
# Go to blog instance and ssh
# Make a dump
mysqldump wordpress > bu.sql
# Make a Bucket
gsutil mb gs://mysqlbus
# Copy the dump to the bucket
gsutil cp bu.sql gs://mysqlbus
# Go in Cloud SQL to Import option
# Select the file from the bucket
# Select Database
# GO
# Edit the config file in the instance
# Path: /var/www/html/wordpress/wp-config.php
sudo nano /var/www/html/wordpress/wp-config.php
# Change DB_HOST for the DATABASE PUBLIC IP
# In the instance, restart the apache service
sudo service apache2 restart