Muly
Search…
Update - Server
This documents outlines the update process of the server-side code.

cPanel

To update the script on cPanel, we have made an easy to follow video available in our YouTube channel on https://bit.ly/muly-cpanel-update link.
If you are using cPanel, you can follow below steps to safely update server side code.
  1. 1.
    Create a backup folder outside your installation e.g., in /home/xxx.
  2. 2.
    Move .env file and storage folder into the backup folder.
  3. 3.
    Delete rest files inside your installation and cleanup.
  4. 4.
    Upload new contents of server folder from update archive into your installation folder.
  5. 5.
    Delete the default storage folder and .env file from newly uploaded update.
  6. 6.
    Restore original .env file and storage from backup into your installation.
  7. 7.
    Run below commands (using Terminal in cPanel) inside your installation folder to update database and cache:
    1
    php artisan config:cache
    2
    php artisan migrate
    3
    php artisan storage:link
    Copied!

LAMP or LEMP

Firstly, create a ZIP archive of the contents of server folder (excluding the parent folder itself). Then upload the created archive to your server using below command:
1
scp server.zip [email protected]:/var/www/update.zip
Copied!
Then SSH into the server and apply the update as follows:
Copied!
1
# change to folder which contains update.zip
2
cd /var/www
3
4
# delete any previous update residuals
5
rm -rf old
6
7
# extract updates.zip to "updated" folder and prepare
8
unzip update.zip -d updated
9
rm updated/.env
10
cat html/.env > updated/.env
11
cd updated
12
php artisan config:cache
13
php artisan migrate
14
15
# change back to original folder
16
cd /var/www
17
18
# stop supervisor (if using background job queue)
19
sudo systemctl stop supervisor
20
21
# restore original "storage" folder and swap live code
22
rm -rf updated/storage
23
mv html/storage updated/storage
24
mv html old
25
mv updated html
26
cd html
27
php artisan config:cache
28
php artisan storage:link
29
30
# fix permissions on new files
31
chown -R www-data:www-data bootstrap/cache storage .env
32
chmod -R 755 bootstrap/cache storage
33
chmod -R 664 .env
34
35
# start supervisor again (if using background job queue)
36
sudo systemctl start supervisor
Copied!
Copy link