The first is to back up the project. This is done both to make sure there is a restore point, but also to generate the necessary files to clone the project.
All projects share the same database designhub, so we have to be careful when we modify tables. At this pointer, there are only two tables.
To back up just the tables necessary, use the following command on the command prompt after signing as designhub:
mysqldump -p designhub master_session master_people > /tmp/master.sql!
This creates a MySQL/MariaSQL dump file /tmp/master.sql.
Run the following commands:
This creates a back up archive that has all the related source files.
Because Power, for the most part, uses Apache as the HTTP(S) server, setting up Express to work requires a little bit of Apache configuration magic. Ask Tak to set up a path and a port number for you, and Tak will reply with the URI path and the port number for you.
Now that you have all the backed up files, a URL path and a port number, you can set up your own sandbox.
I suggest just your last name plus first initial. For the rest of this discussion, we will use Jack Lee as the developer. This means the folder name is leej.
Create the subfolder directly in the home folder using the following command: mkdir ~/leej.
The sandbox includes your own tables. The idea is to replace the prefix master_ with leej_. In this example, you can certainly do it by hand using an editor. However, you can also use the following command: sed -i ’s/master_/leej_/g’/tmp/master.sql.
Now you are ready to create new tables for your sandbox using the following command mysql -p designhub < /tmp/master.sql.
Go to your newly created subfolder using cd ~/leej. Then expand all the files from the backup archive using tar xzvf /tmp/master.tar.gz.
Next, customize a few files. These files are “hidden” files because their names start with a period.
And there you have it!
To run your sandbox, do the following:
While express.js is running, use a browser to visit the URL that Tak gives you.