Migrating CiviCRM to standalone

It has recently become possible to run CiviCRM as a standalone site, rather than as a plugin inside a CMS like Drupal or WordPress. This is great news (I’ve wanted this for a long time) and it works really well for a clean installation but migrating an existing site remains difficult, which will limit adoption. There is a “Standalone Migrate” extension that sometimes helps but the instructions didn’t work for me, it’s not always applicable and I couldn’t find any other documentation for this process. Nevertheless I did eventually achieve a migration on several sites (with or without the plugin), so here’s what worked and didn’t work in case it helps others.

I’ve tested this with CiviCRM version 6.6.3 running on Ubuntu 24.04, migrating from WordPress 6.8.3.

What this achieves:

  • All database contents and files are copied to a new standalone installation, preserving contacts, transaction histories, images and metadata etc.
  • The new installation can be on a different server and the database can be separate from the CMS database.
  • The CMS can still communicate with CiviCRM using form processors and the API.

What it does NOT achieve:

  • Passwords and roles for logged-in users will not in general be transferred – they will have to be manually recreated or reset.
  • Synchronisation of CMS users (e.g. in WordPress or Drupal) with CRM users in CiviCRM will no longer happen. In theory it’s possible, but I’m not aware of any off-the-shelf plugins or extensions that can do this yet.

Note that I have used the cv utility for most actions and I don’t know of any method that avoids the need for command-line access, although it may be possible in theory. The cv utility can easily be installed (or updated) with the following terminal commands.

sudo curl -LsS https://download.civicrm.org/cv/cv.phar -o /usr/local/bin/cv
sudo chmod +x /usr/local/bin/cv
cv --version

I’ve tried to use APIv4 calls rather than accessing the database directly, but that wasn’t always possible because APIv4 is incomplete.

Create a “clean” standalone site

The migration is supposed to require a “clean” target installation, but it’s not clear exactly what that means and it’s not really true – a whole bunch of files need to be copied manually and at least one new administrator created. We will be completely replacing the database contents in any case. What worked for me in the end was to first untar/unzip the latest standalone installation files from https://civicrm.org/download to an empty root folder (e.g. public_html) so that it contains folders core, ext, private, public and a few files, then I used the hosting control panel to create an empty database. The CiviCRM versions on source and target should preferably be the same.

Next visit the standalone site in a browser. Our goal at this stage is just to create a configuration file and check that basic things work like the database connection, file paths, PHP versions and https connections. If the database is empty and no configuration file exists, an installer like this should appear that prompts you for the database location, name, username and password.

On the next screen you are prompted to create a temporary admin user and password, which will allow you to log in to the empty site to check it. A configuration file should be created at private/civicrm.settings.php.

Note that there is currently a bug that means some of the code (rest.php) looks for the configuration file at a different location, core/civicrm.config.php so you will need to copy it there as well, or create a symlink.

cd core
ln -s ../private/civicrm.settings.php civicrm.config.php

Note also that if you do later manage to use the Standalone Migration extension on the origin site, the user you create here can’t be the same as any of the existing users, any existing passwords will be lost anyway and the Change Password page (under the CiviCRM logo in the admin bar) is currently broken (I couldn’t get it to pass the complexity check). The solution is to use the “Forgotten password?” link on the login screen to log in as one of the administrators, which may mean you will need a new working email address for the admin user.

If you get any of this wrong you may need to empty the database, delete the configuration file and start again, perhaps also using a “Private” browser window or clearing caches and deleting cookies to recover.

Copy files

File locations for images, custom files and extensions can be found in Administer > System Settings > Directories in both the original and target systems and are configurable here or in the configuration file. The files in these folders will need to be copied manually between systems using your favourite method, such as a file manager, SSH or the command line.

  • By default, extensions will need to be copied from /wp-content/uploads/civicrm/ext on the source to /ext on the target.
  • Image files typically move from /wp-content/uploads/civicrm/persist/contribute to /public/media.
  • Custom files typically move from /wp-content/uploads/civicrm/custom to /private/attachment.

Check file ownership and permissions carefully afterwards – moving files between sites often changes these and the resulting error messages can be confusing.

Copy database contents

If you do manage to use the Standalone Migration plugin on the origin site there’s no need to copy database contents and it preserves user accounts (but not passwords) so it’s worth a try, using a command like the following.

cv api4 StandaloneMigration.run targetSitePath=/path/to/new/standalone

It worked for me sometimes but not reliably. (I couldn’t resolve errors like “Call to undefined function get_option()”, the API explorer didn’t work, and it’s not expected to work in all situations anyway.)

I’ll assume you will need to copy the database contents manually, using your favourite method such as a control panel, phpMyAdmin or the command line. The original standalone database will be overwritten, user accounts will be lost (but contacts will be preserved) and you won’t be able to log in, so the next task will be to create a new user with administrator privileges.

Make sure the database is upgraded, the “standaloneusers” extension is enabled and caches are flushed using the following commands.

cv upgrade:db
cv en standaloneusers
cv flush

If you now visit the target standalone site in a browser, you should see the login screen. If you see a server error instead, check file ownership and permissions and the existence and contents of the configuration file at private/civicrm.settings.php.

Note that it’s unfortunately normal to see many PHP deprecation warnings from old extensions when you run cv commands, which can make it difficult to see the results.

Delete unwanted roles and users

(Optional) If we’re not using the standalone migration plugin (and even if we are) old users and roles are not much use to us. We can delete them to avoid clashes with our newly created ones, and also to get the database back to a known state. Of course, we keep all existing contacts, it’s only users with passwords that need to be removed or recreated.

# Delete all user-role assignments
echo "DELETE FROM civicrm_user_role;" | cv sql

# Delete all users (civicrm_uf_match entries)
echo "DELETE FROM civicrm_uf_match;" | cv sql

# Delete all roles
echo "DELETE FROM civicrm_role;" | cv sql

cv flush

Authentication

We need to manually configure AuthX for API and web authentication, because they’re not enabled by default and we’re not using the installer or the migration plugin.

cv api4 Setting.set values='{"authx_login_cred":["jwt","api_key","pass"]}'
cv api4 Setting.set values='{"authx_guards":["site_key","perm","user"]}'

Role system

Migration doesn’t preserve the role system, so we need to generate some roles. The following commands will generate roles “Everyone”, “Staff” and “Administrator”, similar to the ones generated by the standalone installer.

You will probably also need a special role for the cron system to use for scheduled jobs – I changed from using the “wp-cli” method to the “cv” method after this migration. If you use the Form Processor extension (which is now the recommended way of connecting a website to CiviCRM) you will also need a role for that. Here are commands to create all those roles.

# Create everyone role
cv api4 Role.create +v name="everyone" +v label="Everyone, including anonymous users" +v permissions='["access CiviMail subscribe/unsubscribe pages","make online contributions","view event info","register for events","access password resets","authenticate with password"]' +v is_active=1

# Create staff role
cv api4 Role.create +v name="staff" +v label="Staff" +v permissions='["access AJAX API","access CiviCRM","access Contact Dashboard","access uploaded files","add contacts","view my contact","view all contacts","edit all contacts","edit my contact","delete contacts","import contacts","access deleted contacts","merge duplicate contacts","edit groups","manage tags","administer Tagsets","view all activities","delete activities","add contact notes","view all notes","access CiviContribute","delete in CiviContribute","edit contributions","make online contributions","view my invoices","access CiviEvent","delete in CiviEvent","edit all events","edit event participants","register for events","view event info","view event participants","gotv campaign contacts","interview campaign contacts","manage campaign","release campaign contacts","reserve campaign contacts","sign CiviCRM Petition","access CiviGrant","delete in CiviGrant","edit grants","access CiviMail","access CiviMail subscribe/unsubscribe pages","delete in CiviMail","view public CiviMail content","access CiviMember","delete in CiviMember","edit memberships","access all cases and activities","access my cases and activities","add cases","delete in CiviCase","access CiviPledge","delete in CiviPledge","edit pledges","access CiviReport","access Report Criteria","administer reserved reports","save Report Criteria","profile create","profile edit","profile listings","profile listings and forms","profile view","close all manual batches","close own manual batches","create manual batch","delete all manual batches","delete own manual batches","edit all manual batches","edit own manual batches","export all manual batches","export own manual batches","reopen all manual batches","reopen own manual batches","view all manual batches","view own manual batches","access all custom data","access contact reference fields","cms:administer users","cms:view user account","administer CiviCRM Data"]' +v is_active=1

# Create admin role
cv api4 Role.create +v name="admin" +v label="Administrator" +v permissions='["all CiviCRM permissions and ACLs"]' +v is_active=1

# Create cron_user role
cv api4 Role.create +v name="cron_user" +v label="Cron User" +v permissions='["access CiviCRM","access AJAX API"]' +v is_active=1

# Create form_processor role
cv api4 Role.create +v name="form_processor" +v label="Form Processor" +v permissions='["access CiviCRM","access AJAX API","add contacts","edit all contacts","view all contacts","access CiviContribute","edit contributions","access CiviEvent","edit event participants","access CiviMember","edit memberships","profile create"]' +v is_active=1

Admin user

The administrator user needs to be associated with a contact, so we create that first. An email address is needed to reset the password using the “Forgotten password?” link. Add it where it says INSERT_ADMIN_EMAIL_HERE.

# Find contact by email (or create if doesn't exist)
ADMIN_EMAIL="INSERT_ADMIN_EMAIL_HERE"

ADMIN_CONTACT_ID=$(cv api4 Email.get +w email="$ADMIN_EMAIL" +s contact_id --out=json 2>/dev/null | grep -o '"contact_id":[0-9]*' | head -1 | cut -d: -f2)

if [ -z "$ADMIN_CONTACT_ID" ]; then
  cv api4 Contact.create +v contact_type="Individual" +v first_name="Admin" +v last_name="User" +v display_name="Admin User"
  ADMIN_CONTACT_ID=$(cv api4 Contact.get +w display_name="Admin User" +s id --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
  cv api4 Email.create +v contact_id=$ADMIN_CONTACT_ID +v email="$ADMIN_EMAIL" +v is_primary=1
fi

cv api4 User.create +v username="admin" +v contact_id=$ADMIN_CONTACT_ID

USER_ID=$(echo "SELECT id FROM civicrm_uf_match WHERE contact_id = $ADMIN_CONTACT_ID;" | cv sql | tail -n 1)
ADMIN_ROLE_ID=$(cv api4 Role.get +w name="admin" --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)

echo "INSERT INTO civicrm_user_role (user_id, role_id) VALUES ($USER_ID, $ADMIN_ROLE_ID);" | cv sql

cv flush

You should now be able to use the “Forgotten password?” link on the login page to set the password for the admin user. Remaining steps can therefore be completed using the administration dashboard if you prefer.

Cron user

To run scheduled jobs automatically using a cron job you will need to use one of the methods described here. We already created a “cron_user” role with appropriate permissions for this purpose above.

cv api4 Contact.create +v contact_type="Individual" +v first_name="Cron" +v last_name="User" +v display_name="Cron User"

CRON_CONTACT_ID=$(cv api4 Contact.get +w display_name="Cron User" +s id --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)

cv api4 User.create +v username="cron_user" +v contact_id=$CRON_CONTACT_ID

USER_ID=$(echo "SELECT id FROM civicrm_uf_match WHERE contact_id = $CRON_CONTACT_ID;" | cv sql | tail -n 1)
CRON_ROLE_ID=$(cv api4 Role.get +w name="cron_user" --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)

echo "INSERT INTO civicrm_user_role (user_id, role_id) VALUES ($USER_ID, $CRON_ROLE_ID);" | cv sql

cv flush

Form processor user

(Optional) If you are going to process forms, add a form processor contact. Create a form processor user and connect them to the contact and the role.

cv api4 Contact.create +v contact_type="Individual" +v first_name="Form" +v last_name="Processor" +v display_name="Form Processor"

FORM_CONTACT_ID=$(cv api4 Contact.get +w display_name="Form Processor" +s id --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)

cv api4 User.create +v username="form_processor" +v contact_id=$FORM_CONTACT_ID

USER_ID=$(echo "SELECT id FROM civicrm_uf_match WHERE contact_id = $FORM_CONTACT_ID;" | cv sql | tail -n 1)
FORM_ROLE_ID=$(cv api4 Role.get +w name="form_processor" --out=json | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)

echo "INSERT INTO civicrm_user_role (user_id, role_id) VALUES ($USER_ID, $FORM_ROLE_ID);" | cv sql

cv flush

The Form Processor needs an API key, which we can easily generate by installing the API Keys extension.

cv ext:enable apikey

Find the “Form Processor” contact in the web interface and generate an API key there, then copy this key and the Site Key (which is also shown on the API Key tab) to the site where the form is hosted. If you are using the Contact Form 7 CiviCRM integration plugin in WordPress, the path to use is core/extern/rest.php. Note that this is a very old plugin and the “Validation failed” warning is incorrect – “administer CiviCRM” permission is NOT required. Also note my comment above about the configuration file being in the wrong place and the need to create a copy or a symlink for this to work.

It’s possible to generate forms in CiviCRM but a big advantage of having them on the host website is you can use a plugin to block spam. (There is a “reCAPTCHA” extension for CiviCRM but it doesn’t work well in my experience.) Also the styling can be consistent with the host site.

Replace hardcoded URLs and paths

The Mosaico extension in particular tends to hard code URLs and paths in the database. To recover missing images and templates after a migration you can install the Mosaico Migration extension.

cd ext
cv dl com.skvare.mosaicomigration@https://github.com/Skvare/com.skvare.mosaicomigration/archive/master.zip
cv en mosaicomigration

Server backups to OneDrive using Duplicacy

The best backups are automated (hence frequent), versioned (so you can recover from deleted or hacked files) and off-site (no worries about natural disasters or the host going bust).

To set them up you’ll obviously need somewhere to store them, and the good news is if you have a Microsoft 365 subscription you already have 1 TB of free OneDrive storage that is probably largely unused. The rest of this post assumes you will use that, but other cloud providers can also be used – there is a slightly different process for using Wasabi, for example.

Unfortunately, most control panels can’t use this sort of cloud storage they expect to backup by SFTP rather than S3 or WebDAV. This is where Duplicacy comes in – it’s fast, efficient and secure, available for Linux, OSX and Windows and the command line version is free for personal use. The catch is it’s a bit tricky to set up and the documentation is sparse, so that’s what this post is about.

This post is specifically about backing up websites from a Linux server – for backups from Windows see our earlier post.

Initial set up

First, we need to download the latest version of the command line executable appropriate to your operating system. For 64-bit Linux at the time of writing this is duplicacy_linux_x64_3.2.4.  The first sentence of the Quick Start quide says “Once you have the Duplicacy executable on your path…”, so we’ll start with that.

Connect to your server console via SSH using a program such as PuTTY (from Windows) or Terminal (from OSX). You will need root privileges to do most of the steps below. If you are a “sudo” user you can use this command to become root temporarily:

sudo -i

You can use the following commands to download the Duplicacy program to  /usr/local/bin and make it executable. For convenience, we’ll rename it to “duplicacy” as well.

wget https://github.com/gilbertchen/duplicacy/releases/download/v3.2.4/duplicacy_linux_x64_3.2.4
mv duplicacy_linux_x64_3.2.4 /usr/local/bin/duplicacy
chmod 0755 /usr/local/bin/duplicacy

If you now type this simple command

duplicacy

you should see a version number and a list of options.

The next step in the Quick Start guide is “…change to the directory that you want to back up” (which they confusingly call the “repository”). Let’s assume you want to back up everything under the /home directory.

cd /home

Next we need to create a directory on OneDrive for storing our backups, and obtain authorization to use it. Using a web browser, log in to onedrive.com and select Files > New > Folder and give this folder a suitable name, such as “Duplicacy”.

OneDrive File > New > Folder

You probably don’t want to synchronise this new folder to your PC, so if you use OneDrive on Windows, open your OneDrive settings (taskbar > cloud symbol > More > Settings):

OneDrive settings

Then click “Choose folders” and make sure the new backup folder is NOT selected.

Duplicacy deselected

Next, visit https://duplicacy.com/one_start in a web browser and click “Download my credentials as one-token.json” (links for other storage providers are here). Upload this to the “repository” location on your server (e.g. /home). You can do this using WinSCP (Windows) or Transmit (OSX).

(Optional) It’s considered good practice to encrypt “data at rest”, which can be enabled using the ‘-e’ option below. I recommend generating a strong, unique password and saving it in a password manager.

Finally you need to choose a “repository id” to identify this computer. A good choice would be the hostname (it must only contain letters, numerals, dashes or underscores). Let’s call it “server”.

Putting this all together, we can now initialise Duplicacy with the following command:

duplicacy init -e server one://Duplicacy

You will be asked “Enter the path of the OneDrive token file (downloadable from https://duplicacy.com/one_start):” and the answer will be the filename and location you used above, for example:

one-token.json

If you used the ‘-e’ option you will also be prompted to “Enter storage password”.

To save having to enter the token location and password every time you run duplicacy and enable unattended backups, you can save them in the preferences file. The commands to do this are described on the Managing Passwords page of the wiki. I recommend moving your token file inside the .duplicacy folder (which has been created by the ‘init’ command above), and setting the permissions so that only root can read it.

mv one-token.json .duplicacy
chmod -R 0700 .duplicacy
duplicacy set -key one_token -value .duplicacy/one-token.json
duplicacy set -key password -value [type your password here]

Making backups

To specify the files to back up, you must create a text file called filters in the .duplicacy folder.  The rules are specified here and can be quite complex but here’s a simple set of rules that will work on most Linux servers:

# Exclude the contents of "tmp", "cache", "logs" and similar directories (case insensitive, ignore leading dots)
e:(?i)/\.?(tmp|cache|.*logs|.*backups|updraft)/
# Include everything else

You can test them with the command

duplicacy backup -dry-run

You’ll probably want to back up your database contents as well. On Ubuntu you can use “apt” to install automysqlbackup for this (yum has no equivalent but you can install it manually).

apt install automysqlbackup

By default the database backups are created in /var/lib/automysqlbackup – you can change that so they are inside the /home directory simply by editing the configuration file /etc/default/automysqlbackup and setting BACKUPDIR=”/home/automysqlbackup” for example.

When you’re happy that the right files are being included, run the command

duplicacy backup

to start your first backup. Depending on the speed of your internet connection this could take several days to complete! Don’t worry, it will be much faster after the first time.

To schedule regular backups at five minutes past the hour every hour, set up a cron job using this command to edit your cron table

crontab -e

and add a line like this:

5 * * * * cd /home && nice -n10 /usr/local/bin/duplicacy backup >/dev/null

Pruning old backups

Duplicacy includes a prune command for keeping the backup size under control. Their example scheme is quite sensible and can be run as a daily task:

duplicacy prune -keep 0:360 -keep 30:180 -keep 7:30 -keep 1:7

It basically means keep no backups older than a year, only monthly backups after 6 months, only weekly backups after a month, and only daily backups after a week.

To run this command once a day at 6:30 am, use a crontab entry like this:

30 6 * * * cd /home && nice -n10 /usr/local/bin/duplicacy prune -keep 0:360 -keep 30:180 -keep 7:30 -keep 1:7 >/dev/null

Restoring files or directories

If the worst happens and you accidentally delete some files, you need to use the Duplicacy restore command. First you have to find which revision number you want. If you know roughly when the problem occurred, the command

duplicacy list

will show you a list of revisions and the dates and times they were made. Alternatively, you can use the “duplicacy history” command to see when changes were made to a particular file or directory, or the “duplicacy diff” command to compare two snapshots or two revisions of a file. Once you know the revision number, you can use the command

duplicacy restore -r <revision> [pattern]

to  restore  a folder or file to its original location. For example, if you wanted to restore revision 42 of folder mysite and all its contents, the command would be

duplicacy restore -r 42 +mysite/*

There are other options shown in the documentation. By default, any existing files in the folder you are restoring to will not be overwritten or deleted.

Free off-site versioned backups using Duplicacy

The best backups are automated (hence frequent), versioned (so you can recover deleted or hacked files) and off-site (no worries about fire or theft).

To set them up you’ll obviously need somewhere to store them, and the good news is if you have a Microsoft 365 subscription you already have 1 TB (a thousand gigabytes) of free OneDrive storage (and other cloud providers can also be used).

By the way – did you know that if you have all your files synchronised to OneDrive, you can restore older versions for 28 days by going to https://onedrive.live.com and selecting the settings (gear wheel symbol) at the top right, then Options > Restore your OneDrive > Select a date?

Restore OneDrive

Unfortunately, standard backup software like Microsoft File History and Apple Time Machine can’t use this sort of cloud storage. They also struggle to back up large files that are constantly in use, like mail archives and log files. This is where Duplicacy comes in – it’s fast, efficient and secure, available for Windows, OSX and Linux and the command line version is free for personal use. The catch is it’s a bit tricky to set up and the documentation is sparse, so that’s what this post is about.

This post is specifically about Windows backups – for backups from Linux see our later post.

Initial set up

First, download the latest version of the command line executable appropriate to your operating system. For Windows 10 64-bit at the time of writing this is duplicacy_win_x64_3.1.0.exe.  The first sentence of the Quick Start quide says “Once you have the Duplicacy executable on your path…”, so we’ll start with that.

On Windows right-click on the Windows start button and open a Windows Powershell (Admin). You will need administrator privileges to install the program and also to run it later in the background, so make sure you do all of the following as an admin user.

You can use the following Powershell commands (or File Manager) to copy the Duplicacy executable we just downloaded to C:\Windows\system32. For convenience, we’ll rename it to “duplicacy.exe” as well.

cd ~\Downloads
ren duplicacy_win_x64_3.1.0.exe duplicacy.exe
mv duplicacy.exe \Windows\system32

If you now type this simple command

duplicacy

you should see a version number and a list of options. If not, enter this command to find what your “path” environment variable is set to, and copy the duplicacy.exe file to one of those locations.

$Env:Path

The next step in the Quick Start guide is “…change to the directory that you want to back up” (which they confusingly call the “repository”). Let’s use our home directory.

cd ~

Next we need to create a directory on OneDrive for storing our backups, and obtain authorization to use it. Using a web browser, log in to onedrive.com and select Files > New > Folder and give this folder a suitable name, such as “Duplicacy”.

OneDrive File > New > Folder

You don’t want to synchronise this new folder back to your PC, so open your OneDrive settings (taskbar > cloud symbol > More > Settings):

OneDrive settings

Then click “Choose folders” and make sure the new backup folder is NOT selected.

Duplicacy deselected

Next, visit https://duplicacy.com/one_start and click “Download my credentials as one-token.json” (links for other storage providers are here). Save this to your home folder (e.g. C:\Users\myname).

Finally you need to choose a “repository id” to identify this computer. A good choice would be the computer name from Start > Settings > System > About > Device name. Let’s say it’s “My-PC”.

Putting this all together, we can now initialise Duplicacy with the following command:

duplicacy init My-PC one://Duplicacy

You will be asked “Enter the path of the OneDrive token file (downloadable from https://duplicacy.com/one_start):” and the answer will be the filename and location you used above, for example:

one-token.json

Making backups

To specify the files to back up, you must create a text file called filters in the .duplicacy folder that you should now find in the root of your repository.  The rules are specified here and can be quite complex but here’s an example set of rules that will work on most Windows machines:

# Exclude files and folders that begin with a dot
-.*
# Exclude the AppData folder and some others
-AppData/
-Downloads/
-NTUSER.DAT*
-ntuser.dat*
-MicrosoftEdgeBackups/
# Back up everything else for this user

When you’re happy that the right files are being included, run the command

duplicacy backup

to start your first backup. Depending on the speed of your internet connection this could take several days to complete! Don’t worry, it will be much faster after the first time and it’s OK to interrupt it. You will probably want to (temporarily) prevent your computer going to sleep until it’s done by going to Start > Settings > System > Power & Sleep > Sleep then selecting PC goes to sleep after: Never.

If you see an error message saying a file is “in use” or “locked by another user” you can take advantage of a feature that is only available only on Windows and only for  administrators called “Volume Shadow Copy”. It cleverly locks the file, takes a quick copy then unlocks it again. You can do it like this:

duplicacy backup -vss

To schedule regular backups once an hour, as an administrator run Task Scheduler (under Windows Administrative Tools in the Windows Start menu) and select Create Task… at the right. Give the task a name and  select Run whether user is logged in or not (this prevents annoying pop-up windows every time it runs).

Duplicacy task pane

In the Trigger tab, under Begin the task select At startup. Then under Advance settings for Repeat task every select 1 hour for a duration of: Indefinitely.

Duplicacy task trigger pane

Under the Action tab,  for Program/script enter duplicacy with argument backup and Start in (optional): C:\Users\<your home folder>.

Duplicacy backup actions tab

Under the Conditions tab, under Network, select the option Start only if the following network connection is available: Any connection.

When you click OK so save the task, you will be prompted for an Administrator’s username and password.

Pruning old backups

Duplicacy includes a prune command for keeping the backup size under control. Their example scheme is quite sensible and can be run as a daily task:

duplicacy prune -keep 0:360 -keep 30:180 -keep 7:30 -keep 1:7

It basically means keep no backups older than a year, only monthly backups after 6 months, only weekly backups after a month, and only daily backups after a week (and hourly backups until then).

Restoring files or directories

You can restore files using the Duplicacy Web Edition graphical application (which is free for this purpose), or from the command line using the Duplicacy restore command. First you have to find which revision number you want. If you know roughly when the problem occurred, the command

duplicacy list

will show you a list of revisions and the dates and times they were made. Alternatively, you can use the “duplicacy history” command to see when changes were made to a particular file or directory, or the “duplicacy diff” command to compare two snapshots or two revisions of a file. Once you know the revision number, you can use the command

duplicacy restore -r <revision> [pattern]

to  restore  a folder or file to its original location. For example, if you wanted to restore revision 42 of folder Music the command would be

duplicacy restore -r 42 +Music/*

There are other options shown in the documentation. By default, any existing files in the folder you are restoring to will not be overwritten or deleted.

Support for TLS 1.0 encryption ending

Did you know that support for TLS 1.0 encryption (which dates from 1990) ends this month, and Office 2010 doesn’t support anything later?
 
Why does this matter? It matters because there are several known exploits for this old encryption standard, which means that a determined hacker could “sniff” your login passwords. And a hacked email account can be used to reset the password on other online accounts, so there is a strong financial incentive for hackers.
 
The solution, as always, is to keep your software updated and make sure you have good backups.
 

Don’t panic about GDPR and make it worse

Customers are asking me whether they need to do anything about the new GDPR regulations. They want me to tell them that either they don’t need to worry because they don’t have a mailing list, or they just need to send everyone their privacy policy and everything will be fine. It’s not as simple as that because data can be stored in many ways and for many reasons – you need to actually read the guidelines to decide what applies to you.
 
The best explanation I’ve seen is here so take a few minutes to read that. In particular, you may have “legitimate interests” for storing personal data even if you can’t demonstrate consent.
 
Don’t just email all your contacts “to be safe” as everyone seems to be doing this week. That in itself may be illegal and make the problem worse. But that doesn’t mean you have to wipe your address book either. The following link has more details:
 

Stable patches for the “Spectre” vulnerabilities

Stable patches for the “Spectre” vulnerabilities are beginning to appear at last. If your computer is only a couple of years old you should check for a BIOS update. They’ll slow down your machine a bit but running unpatched for too long is asking for trouble.
 
It’s pretty scandalous that these bugs (Spectre and Meltdown) were released in the first place, even more scandalous that they went unreported for years and disastrous that for many people the only way to fix them now is to throw away every device that contains one of the affected processors (pretty much anything that connects to the internet) and buy new ones. I hope the CPU manufacturers are ashamed.
 

Quick guide to speeding up a laptop

It’s really easy to speed up most laptops. Dramatically.

1.   Kill most background programs

On Windows 10, press Ctrl + Alt + Del then Task Manager and select the Start-up tab. Disable all non-essential programs one by one. You may have to log in as an administrator if the button is greyed out.

Startup window

Then go to Settings > Privacy > Background apps and disable most of those. (On Windows 7 search for the command “msconfig” instead.)

On Mac OSX, go to System Preferences then Users & Groups then Login Items and click the minus button to disable each non-essential program.

OSX Login items

2.   Nix the antivirus

Believe it or not, most commercial antivirus programs do more harm than good. Uninstall them! On Windows 10 the built-in Defender will automatically activate and is just as effective with far fewer problems. (For Windows 7 search Microsoft.com for free “Security Essentials” which does the same thing.) Mac OSX also comes with enough built-in protection these days.  Now reboot your laptop and notice how quickly it starts up!

3.   Check the performance monitor

On Windows 10, open the Task Manager again but this time select the Performance tab. The graphs of CPU, Memory, Disk and Ethernet should all be pretty low now. If not, click the Processes tab to find the culprit.

Windows performance monitor

On Mac OSX, go to Finder then Go then Utilities and select Activity Monitor.

If Memory usage is high, adding some RAM is often a quick and cheap (less than £50) solution. If Disk usage is high, changing your hard drive to an SSD (solid state drive) is also cheap now and very effective – and will save battery life. We can help you buy the right ones and fit them. If CPU usage is high, fix the other two first.

OSX activity monitor

4.   Check for malware

Computers are sometimes slow due to malware. Here’s a really quick way to check if a Windows laptop is infected. Download “Process Explorer” from https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer. Extract the files (right click, extract all) then run procexp.exe. You will see a list of processes running on your computer (make sure all your usual programs are started – this test won’t check dormant programs on your hard disk).

Now click Options then VirusTotal.com and select “Check VirusTotal.com”. After a short delay this free service will check your computer memory against over 50 different virus checkers and report the results as a column of blue figures at the right. The number indicates how many virus checkers reported a warning (a few false alarms is normal) and the second number is the total number of checks.

Virus Total results

5.   Install an Ad blocker

This tip is specifically for browsing the internet. Most web browsers now include a “pop up” blocker by default, but you have to install a “plugin” or “extension” if you want them to block advertisements. Popular ad blockers include “AdBlock” and “Adblock Plus” – they’re very similar and easily installed, for example from https://chrome.google.com/webstore for Chrome, https://addons.mozilla.org for Firefox or https://www.microsoftstore.com for Edge (unfortunately not available for Internet Explorer, Safari or phones).

Advertisements quite often contain malware so it’s a good idea to block them for security reasons as well as for speed. Some sites rely on ads for income and won’t load unless you make an exception for them, but I still encourage you to try out an adblocker, it saves a lot of time and aggravation.

6.   Install security updates automatically

This last tip is more about security than speed, but it will save you time by installing important security patches automatically, not to mention time spent recovering from an infection. Windows will automatically update itself and Microsoft Office, but what about all your other programs? ? One answer is a free program called Patch My PC that you can download from https://patchmypc.net/.  Mac OSX users don’t need this because the App Store controls all updates.

Enjoy your fast laptop and tell your friends!