Mecha CMS

Updates.

Updating Mecha Manually

Author: Taufik Nurrohman · 931 Views

Tweet

This is just a visualization for my previous article here.

Currently, Mecha version 2.x.x is still in active development, so it is normal when you want to see what’s new by updating your Mecha site multiple times. There will be a time when you get to see that everything is broken by your own hand. Common practices like copying and pasting new files to overwrite the old files aren’t safe because pasting will only override the currently available files, but doesn’t know what files need to be deleted. In this tutorial, I will explain step by step how to update your Mecha site safely with better visualizations.

Step 1: Create a Site Copy 

Before doing anything, make sure that you have created a local copy of your site, either as its normal files and folders or as a package. Save it somewhere outside the working directory!

Step 2: Create a Temporary Folder 

Create a temporary folder in the root folder of your Mecha site then name it as you like. Let’s say it test:

1

Step 3: Install a Fresh Mecha Package 

Download the package from here then put it in the test folder. Extract it!

2

Step 4: Moving the Static Files 

Now go to the lot folder of the parent folder then select all folders that contain static files, including the state folder. Copy or cut them all then paste in .\www\test\lot:

3

Note: You may delete the page folder first, which contains some default pages as the site example.

Step 5: Make Sure That the Site is Running 

Now visit http://localhost/test to make sure that the site is visible as expected even without any custom extensions and plugins at all:

4

Note: If you get a red message like Shield::attach(false) in the page then it was caused by your shield property that has been set to a value other than document. This message will appear when the site is missing your custom shield folder. Open .\www\test\lot\state\config.php then make sure that the shield value is set to document.

Step 6: Extensions, Plugins and Shields 

Everything is OK. You can start installing the previous shields, extensions and plugins that is located in the parent folder. But it is a good practice to install the fresh version of them instead of moving the previous extensions, plugins and shields one by one.

Step 7: Double Check the 5th Step 

Double check the 5th step to make sure that everything is OK.

You may need to configure back the shields, extensions and plugins to match with the previous configuration value. Most of them are stored in:

  • .\www\lot\shield\{$shield}\state\config.php
  • .\www\lot\extend\{$extend}\lot\state\config.php
  • .\www\lot\extend\plugin\lot\worker\{$plugin}\lot\state\config.php

Step 8: Delete All Files in the Parent Folder 

Delete or move all files in the parent folder (except the test folder) to a new folder, just in case:

6

Step 9: Restore the File Locations 

Move all files that are now placed in the test folder to its parent folder:

7

8

Step 10: Delete the Temporary Folder 

You can now delete the test folder!

9

So that you will get only this:

10

Step 11: Upload the Site 

You can now pack the updated site then upload it to the web server. There are some things to be concerned:

  • The best way to update the online site is by deleting the entire site and then replacing it with the new one instead of overwriting the site files.
  • Some site data like comments, polls, and views are mostly generated by your visitors. Remember that! Make sure you don’t make a mistake by deleting them!

2000000000

0 Comments

No comments yet.