Update SightPress¶
This guide shows you how to move an installation to a newer version of SightPress, keeping every website, page, account, menu and setting. It covers updates up to 0.4.
Make a copy first
Before you update, make a copy of the skeleton folder, including the sites folder and the .env file, and of
every website's database if it isn't an SQLite file in sites. Without the APP_SECRET from .env, SightPress
can't open the websites' databases.
Update¶
Type these commands in the skeleton folder.
- Stop SightPress: press Ctrl+C in the window where it runs, or type
docker compose down. -
Get the new skeleton:
If Git says that your changes to
config/tenant.phpor another file would be overwritten, see New settings in 0.3 and copy the new parts in by hand. -
Get the new version of SightPress itself:
-
Update the list of websites to the new format (from 0.4 on, it can hold each website's upload limits):
You should see that the file was upgraded, or that there is nothing to do. The old file is kept as
config/sites.php.bak. -
Update the database tables of every website:
You should see one line per website saying how many database migrations ran. One website failing doesn't stop the others; run it again for that website once the problem is fixed.
-
Build the search index of each website, replacing
demowith its short name: -
Start SightPress again with
docker compose up. The scheduler starts with it now (see below). - Check: sign in to a website. The admin menu now has Features, Analytics and Redirects, and your pages, people and menus are as they were.
What changes for your websites¶
- Site search and Analytics are on for every website after the update. Turn them off on the Features screen if you don't want them.
- The AI assistant is off. Nothing is sent to any AI service until an admin sets it up; see Use the AI assistant.
- Sign-up is off and every website is still readable by everyone, as before.
- The Privacy notice starter page of websites made before the update doesn't describe analytics. Add a section about it yourself; See who visits your website explains what is counted.
New settings in 0.3¶
.envhas a block of upload limits (UPLOAD_MAX_SIZE,INPUT_MAX_SIZEand others). Copy the block from.env.example; without it, the recommended values are used. See Fix upload size limits.config/tenant.phphas two new sections:modules, which sets the features of every website (see Turn features on or off), anduploads, which tells SightPress the web server's limit.-
docker-compose.ymlhas a scheduler service, which publishes scheduled pages and keeps the analytics up to date. It runsbin/sightpress schedule:runonce a minute. On a server without Docker, add this line to the crontab of the user that runs SightPress (crontab -e), with the path of your project:* * * * * cd /var/www/my-site && php bin/sightpress schedule:run --no-interaction >> var/log/schedule.log 2>&1Run it in one place only per installation.
New in 0.4¶
Follow the same steps. Step 4 is needed for this update. After it:
- The look of your websites stays the same. The default theme now comes as its own package, which Composer
installs.
composer updatealso publishes the theme files and previews. - Your files stay where they are. Nothing moves to the cloud unless you set it up.
- A published page with a video without captions, or a recording without a transcript, stays published, but the publish check asks for them the next time it is published. See Add captions and transcripts.
config/tenant.php has new optional sections. Copy them from the new skeleton if Git can't merge them:
themes: which installed themes websites may use, and the theme of new websites.media.limits: every website's upload limits and the most a website may set.uploads.temp_pathanduploads.max_chunked_bytes: where large files wait while their parts arrive, and the largest file that can be sent in parts.
If something goes wrong¶
- A website shows an error page after the update
- Its database tables are older than the code. Run
site:migratefor it (step 5) and read the message it prints. - An error says
config/sites.phpuses an older format version - Run
site:registry:upgrade(step 4). composer updatefails- Check that you are in the
skeletonfolder and that SightPress is stopped, then try again. Your websites are not changed until step 4. - Search finds nothing
- Pages are added to the search index when they are published or changed. Run step 6 for that website to add the pages that were already there.