forked from anvc/scalar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UPDATE.txt
124 lines (105 loc) · 7.49 KB
/
UPDATE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
----------------------------
Scalar Updating Instructions
----------------------------
Scalar is a PHP and MySQL application built with CodeIgniter.
***
This document assumes that you have a working copy of Scalar operating on your server, and that you wish
to update to the most recent Scalar release. If you wish to install Scalar from scratch please see INSTALL.txt.
Of course, you can always update your Scalar install from the most recent build on GitHub. However,
sometimes bugs can be introduced by commits to GitHub that haven't yet been verified by Scalar's development
team. For this reason we keep checkpoints ("releases") of Scalar using GitHub Releases. Details below.
***
***
A note on file uploads:
Scalar authors can upload files to your server under Import > Local Media Files (the files are placed in the
directory corresponding to their book's URL segment). We strongly suggest protecting your filesystem against
potentially malicious uploads, such as *.php files. We have a template for this in place in the root folder's
.htaccess file. Edit, uncomment the "malicious file uploads" rewrites, and set appropriate fields to let
through requests to system files.
***
***
A note on SSL (https):
As of Release 2.0.2 SSL (https) is supported out of the box. If needed we have a template in the root
folder's .htaccess to force all requests through https. Be aware, though, running Scalar under https might
cause conflicts with plugins or media players that are running under http, meaning, websites running https
generally can't embed content running under http.
***
To begin take a look at the "Changes to config files over time" wiki page (https://github.com/anvc/scalar/wiki/Changes-to-config-files-over-time).
Here we list any updates to Scalar config files or the database scheme that will need to be made on your
install for the update to work properly. Each update is marked by the date it was added (and therefore the
date that the codebase assumes that the update exists).
INSTRUCTIONS FOR UPDATING TO SCALAR 2.1.x FROM SCALAR 2.1 OR SCALAR 2.1.1
If you're updating from a version before 2.1, see further down below.
1) Extract the release ZIP to your local computer
2) Copy all folders in /system/application to the corresponding folder on your webserver EXCEPT:
(These are folders that have install-specific config files, so we don't want to overwrite the ones you have on your webserver:)
system/application/cache
system/application/config
system/application/language
system/application/logs
system/application/plugins
3) Update all folders in the /system folder EXCEPT:
(You just updated /system/application in step #2, so don't update it here:)
system/application
4) Check to see if there are any changes to config files or the database scheme at "Changes to config files over time" (https://github.com/anvc/scalar/wiki/Changes-to-config-files-over-time)
All done! To test, you can check certain elements of Scalar including the Dashboard, media elements (media
included in pages), and the page editor.
INSTRUCTIONS FOR UPDATING TO SCALAR 2.1.1 FROM SCALAR 2.1
1) Overwrite all folders in /system **except** for the "applications" folder
2) In /system/application, update these folders:
arc
(don't copy cache)
(don't copy config)
controllers
core
errors
helpers
hooks
(don't copy language)
libraries
(don't copy logs)
models
(don't copy plugins)
rdf
views
INSTRUCTIONS FOR UPDATING TO SCALAR 2.1 OR SCALAR 2.1.1 FROM ANY PREVIOUS SCALAR VERSION:
1) Extract the release ZIP file into a NEW folder; make sure that .htaccess is visible or transferable in the root folder so it doesn't get left out
3) Optional: open "codeigniter.php" in the NEW root folder and change "production" to "development", to display PHP errors during development
2) Copy "system/application/config/local_settings.php" from the existing LIVE folder location to its corresponding NEW location
4) Do not copy any other config files; rather, copy values kept in the files in the existing LIVE folder to the files in the NEW folder. Unless you've made a lot of changes these are likely the only values you'll need to migrate:
system/application/config/config.php: $config['uri_protocol']
system/application/config/config.php: $config['log_threshold']
system/application/config/config.php: $config['encryption_key']
system/application/config/config.php: $config['cookie_prefix']
system/application/config/config.php: $config['cookie_domain']
system/application/config/database.php: $db['default']['hostname']
system/application/config/database.php: $db['default']['username']
system/application/config/database.php: $db['default']['password']
system/application/config/database.php: $db['default']['database']
system/application/language/content_lang.php: $land['install_name']
5) Optional: edit .htaccess in the existing LIVE root folder, and remove the # comment characters that prepend the two lines under "# To route all requests to a maintenance page, uncomment these lines", then save; this will temporarily make Scalar unavailable, routing all requests to maintainance.html.
6) Delete the "system" folder from your existing LIVE root folder (or, to be safe, rename the system folder to "system.bak")
7) Copy the NEW "system" folder to the existing LIVE root folder
8) Overwrite the "codeigniter.php" in the existing LIVE root folder with the "codeigniter.php" in the NEW root folder
9) In Scalar's MySQL database, change the "ip_address" field in "scalar_db_sessions" to VARCHAR(45), or simply run this SQL statement:
ALTER TABLE scalar_db_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL
10) Optional: edit .htaccess in the LIVE location again; add the # comment characters back to the two lines under the maintenance comment; saving will bring Scalar back from being unavailable
11) Check https://github.com/anvc/scalar/wiki/Changes-to-config-files-over-time to see if any other changes to the database or local_settings.php are needed
12) Check to make sure Scalar is working properly. If so, delete "system.bak" (if applicable). Enjoy!
Note: you may need to change the permissions of system/application/logs so that CodeIgniter can write log files if you have them enabled in config.php.
Note: you'll need to reinstall the import/export transfer tool: download it from https://github.com/Michael628/scalar-book-transfer-tool and place in a new folder "transfer" at system/application/plugins/transfer
INSTRUCTIONS FOR UPDATING ANY SCALAR VERSION BEFORE 2.1 TO ANY OTHER SCALAR VERSION BEFORE 2.1:
Step 1
a) Update your database scheme based on "Changes to config files over time" (https://github.com/anvc/scalar/wiki/Changes-to-config-files-over-time).
b) Update your config files based on "Changes to config files over time". Config files are kept in two places:
system/application/config -- most changes to config files will be here
system/application/language -- text such as the name of your Scalar install is kept here
Step 2
a) Download the most recent release of Scalar (https://github.com/anvc/scalar/releases).
b) Extract the compressed file and prepare to upload its contents.
Step 3
a) Upload all of the folders inside "system/application" **except** the aforementioned config folders (system/application/config & system/application/language).
This will ensure that you don't overwrite your config files with default values.
b) Make sure that hidden files are copied to your server (some FTP clients hide .htaccess files).
All done! To test, you can check certain elements of Scalar including the Dashboard, media elements (media
included in pages), and the page editor.