This is simple shell script to upgrade your concrete5 site overriding the core "concrete" directory. This is suitable for someone who don't want to pile up concrete5 versions in "update" directory.
Since you're using GitHub, I assume you know what you're doing. This is the script that runs on your server.
This upgrade script supports Ver 8.0.0 and above fully, and 5.7.x partially
This script is licensed under The MIT License. USE IT AT YOUR OWN RISK.
Video tutorial is available on YouTube
English
日本語
- Someone who's concrete5 site owners who runs many concrete5 sites.
- Someone who's using the servers that accepts SSH access.
- Someone who also runs concrete5 development site and test upgrade before running actual upgrade.
- Someone who has an idea of what this shell script does for you automatically, and know how dangerous this site could be.
Katz Ueno (concrete5 Japan, Inc)
Please feel free to create an issue or send me a pull request. Your feedback is always welcome!
Yes, we use this script to maintain our customers site at dedicated servers and cloud servers such as AWS.
We are one of the Amazon Web Services APN Technology Partners.
- I would like your feedback.
Release
You need to have the server that allows to run the shell script.
- Obtain the shell script from GitHub. https://github.com/katzueno/concrete5-upgrade-shell Or Click here to download zip file.
- BACK UP YOUR concrete5 SITE, I highly recommend you to use the backup option. If you're interested in backup only option, you can check out my concrete5 Backup Shell
- Add your server config in
concrete5-upgrade.sh
- Upload the
concrete5-upgrade.sh
to your server - Change the file permission
chmod 700 concrete5-upgrade.sh
Or whatever the permission you need to execute the file. But make sure to minimize the permission.
It's highly advised that you know what you're doing with this script. You MUST have certain amount of knowledge of what shell script is.
This script first save the SQL dump file onto concrete5 directory. If the script fails, it may leave the SQL file under the server. MAKE SURE to check the server occasionally.
I highly recommend that you make the duplicate of your concrete5 site somewhere else to do test upgrade. This script is making you easy to test upgrade. Why not do it now!?
YOU MUST SPECIFY 1st, 2nd and 3rd option, and you must choose -n
or --no-upgrade
option.
If you're using concrete5.7.x, it cannot run upgrade from shell. You will need to run upgrade manually. You may want to change your concrete5 config to allow auto update core option.
- Create a text file
application/config/concrete.php
if you haven't done so. - Place the following code onto the text file.
- OR you could use the text file that I prepare under /config/concrete.php
- Upload the file onto your concrete5 and make sure that you don't generate any error.
<?php
return array(
'updates' => array(
'enable_auto_update_core' => true
),
);
You may already made the concrete.php and enter another config setting, just place updates option accordingly.
At default, you still need to enter the MySQL Password.
cd path/to/shell/file
sh concrete5-upgrade.sh [1st option] [2nd option] [3rd option] [4th option]
cd /var/www/html
sh concrete5-upgrade.sh --all --do-not-delete --run-upgrade --relative
1st option will determine if you want to back up concrete5 before upgrading
- -n
- --no-backup
back up a SQL and the files in application/files
- [no option]
- --files
- --file
- -f
back up only a SQL dump file under WHERE_IS_CONCRETE5 path
- --database
- -d
back up a SQL and all files under WHERE_IS_CONCRETE5 path
- --all
- -a
back up a SQL, and the files in application/files, packages/
- --packages
- --package
- -p
Shows all the help options.
- --help
- -h
You MUST specify 1st option if you want to specify 2nd option.
When running this shell script, it will create concrete5_upgrade_working
(default value) directory and save all upgrade related and store older version concrete5 core and language files.
At the end of the process, you can choose to keep or delete those directories.
- [no option]
- -n
- --do-not-delete
- -d
- --delete
You MUST specify 1st and 2nd option if you want to specify 3rd option.
At the end of the process, it will run concrete5 upgrade command from concrete5 command line tool.
HOWEVER, this upgrade command is only available from Version 8.0.0.
You should disable the option. OTHERWISE, the upgrade process will stop before
- [no option]
- -r
- --run-upgrade
- -n
- --no-upgrade
You MUST specify 1st~3rd option if you want to specify 4th option.
4th option determine if you need to work as absolute path or relative path. A Mac OS User reported that they need to be specify absolute path. You may need to use the ABSOLUTE option if you're running this as a cron job.
The shell runs relative path.
- [default]
- -r
- --relative
The shell always use absolute path when dumping and zipping files.
- -a
- --absolute
Once you download the sh file, you must change the where VARIABLES are from line 15
Default:date "+%Y%m%d%H%M%S"
It would add current year, month, date, hour, and seconds to the backup files.
For example, if you think you don't want to put all the minutes and second, remove %M%S
.
Enter the full server path of where your concrete5 site is installed
e.g.
WHERE_IS_CONCRETE5="/var/www/html/concrete5"
Enter the URL of concrete5 zip package URL from concrete5.org
e.g.
CONCRETE5_DOWNLOAD="http://www.concrete5.org/download_file/-/view/92910/"
Enter the name of the folder name that concrete5 zip file. It's usually like "concrete5-8.X.X" or "concrete5.7.X.X".
e.g.
CONCRETE5_VERSION="concrete5-8.0.2"
Enter the server full path where you want to save your backup files to.
e.g.
WHERE_TO_SAVE_BKUP="/var/www/html/backup"
HINT: If you don't know where to find, use "pwd" command to find your current location of the server to find the full path of the server.
Default: /var/www/html/concrete5_upgrade_working
The shell script will create the working directory to store zip file, older concrete5 core and language files. You can change the working folder name.
e.g.
WHERE_TO_SAVE_TEMP="/var/www/html/concrete5_upgrade_working"
Enter the identical file name. This will be the prefix of your file.
e.g.
FILE_NAME="katzueno"
Enter the MySQL server address.
e.g.
MYSQL_SERVER="localhost"
Enter the name of your MySQL database.
e.g.
MYSQL_NAME="database"
Enter the MySQL username
e.g.
MYSQL_USER="root"
If you don't want to enter the password every time, uncomment the MYSQL_PASSWORD and enter the MySQL password.
e.g.
MYSQL_PASSWORD="root"