The MojoMotorist - For All Things Related to the MojoMotor CMS

Moving Mojo From Local to Production

MojoMotor was originally designed to be built out on the production server, but many of us as developers prefer to work locally, either on XAMPP or MAMP, and then deploy to the production server. Fortunately, by following just a few steps we can get this workflow going with Mojo!

I’m assuming that you are familiar with running a local development environment, so I won’t be covering the aspects of setting that up on your computer.  If you are curious on what that is about, take a look at Sean’s article here.

Step 1: Build Out Your Local Site

Once you have gone through and created all your artwork, HTML, and other frontend markup, go ahead and port it over to Mojo.  At this point you can just develop as normal, or as if it were on the production server.  When I use MAMP PRO, I will set up my local domain using the “.local” TLD.  Then, when I move it to the production server, I will change that to the .com, or .org, etc. 

After I get most of the site functionality working on my local environment, it’s time to move on to the next step.

Step 2: Upload Assets to Production Server

Using Transmit, or some other FTP program, upload the entire site, including the MojoMotor files, to your production server.  There really isn’t anything special here! Just upload your files.

Step 3: Dump Your Database & Update It

Since I use MAMP locally, I will jump into PHPMyAdmin and dump the entire database to a file.  Now, there are a couple of things that must change in the database file before uploading it to the production database server.

Do a search and replace to update your “domain.local” to the production domain.

Find and Replace on Database

Update the “server_path” field in the “mojo_upload_settings” table with your production server path. If you forget to update the path, you will be greeted with an error next time you try to upload an image.

Remember to Update the Upload Path

After you’ve cared for updating the DB information, go ahead and upload it to the production database server using PHPMyAdmin or Navicat.

Step 4: Update Config.php & Database.php

Once you’ve uploaded all the file assets to the server, open up the remote copy of config.php, which is located at system/mojomotor/config/config.php.  You will need to update line 15 with your production domain.  Before updating it, it will have your .local domain.

Updating Config.php File

Open up database.php which is at system/mojomotor/config/database.php and update it with your production database connection settings.

Updating Database.php

Step 5: Verify Permissions

Sometimes when you transfer files from your local machine to the server the file permissions get a little wonky, so make sure that config.php and database.php are chmod’ed to 666.  If you run into uploading problems, double check that the mm_uploads directory is set to 777.

Step 6: Check Your Site!

Hopefully at this point your site is up and running on your production domain!  If not, go back through these steps and verify that you have done it properly!

Comments

There are no comments for this article.

 

Leave A Comment