Backup to Dropbox

Backup data to your own Dropbox account

Having a backup of your kiwitrees data is an essential part of managing your web site. This module provides a way to store your backup files in a Dropbox account.

There are two main areas you should backup regularly:

  1. Your kiwitrees database (MySQL)
  2. Your media objects (the folder “/data/media/”)

Other things you might also want to protect could be:

  1. A GEDCOM file copy of your family tree data (but remember that all of the same information is held in your MySQL database)
  2. Custom theme files you have created (see this FAQ)
  3. Historical time line files you use (e.g. “histo.en_GB.php”)

With a little thought and preparation of the above can be saved to your Dropbox account as often as you want using this module.

I do not recommend keeping a backup of the kiwitrees software, as that is always easily downloaded and re-installed from this site.

The module, once fully set up as described below will, from a single click, copy any files or folders you choose from your kiwitrees/data/ folder to your Dropbox account.

Setup and use the “Backup to Dropbox” module

Important note: before planning to use this module you must have your own Dropbox account. If you do not already have one, it can be created, at no cost, following the instructions on this page: . You also need to create a “Dropbox app”, which is described in the second step below.

1 – Enable the module in kiwitrees (Administration > Modules > Manage modules)

2 – Create a Dropbox app

Creating the app takes only a few moments. It is done at this web page: . On the first page select the options as shown below, and include your own choice of title for the app. I chose “Kiwitrees file backup” for mine, but it can be anything, except that it must be unique across all Dropbox accounts, so you may need to get creative! Then click “Create app”.

Create a Dropbox app - 1

click to enlarge

On the second screen check the first set of entries are as you wanted, then look for the “Generate” button for your access token. Click that.

Create a Dropbox app - 2

click to enlarge

When the access token is displayed you need to copy and keep it. You will need to use it in kiwitrees when you set up the module.

Create a Dropbox app - 3

click to enlarge

3 – Set up the kiwitrees module (Administration > Tools> Backup to Dropbox).

Create a Dropbox app - 4

click to enlarge

  • In field “A” enter the title of your Dropbox app.
  • In field “B” enter your Dropbox access token. (Note: The module will not work until both A and B are entered.)
  • In field “C” (optional) list any files or folders that exist in your kiwitrees/data/ folder that you do NOT want to backup to Dropbox.
  • Click “Update” to save these entries.

The module is now ready to use. In the lower half of the page is a list of the files and folders ready to be copied to Dropbox.

Some hints and tips on using this module

  1. If you want to backup any other files, such as custom theme files, place copies of them in your kiwitrees/data/ folder, or any sub-folder of it that you choose to create. They will have no effect on the operation of kiwitrees, but will be available for backup to Dropbox.
  2. To place a backup of your kiwitrees MySQL database in Dropbox there are to methods to consider:
    1. If you use the kiwitrees add-on “MySQLDumper” (“MSD”) module, then you have the option to send a copy of the backup file it creates straight to your kiwitrees/data/ folder. This is my preferred solution. If you look at the image in 3. above you will see files like “family_2016_09_14_15_39.sql.gz”. These are from MySQLDumper and are the last two complete database dumps. This FAQ is not intended to explain how to use MSD, but the area to look in to get copies in the /data/ folder is Configuration > FTP in the MSD tool.
    2. If you prefer to create manual dumps of the database using phpMyAdmin or a similar database tool, then simply copy the zipped file it creates into kiwitrees/data/.
  3. A warning: if you have a large number of media objects the process of copying them all to Dropbox can be very slow, and may cause your server to timeout (error 504). Generally if you click f5 (on PCs) to refresh your screen the process will continue. In testing it was  particularly bad when a large number of media sub-folders were used.
  4. I have not yet found a satisfactory way to provide feedback on the progress of the copying. But most browsers do display (often in the browser tab label) a “spinning disk” to show that a process is still running.
  5. To include a copy of a GEDCOM file of your family tree data you should go to Administration > Family trees > Manage family trees ; select “Export a GEDCOM file”, and click “continue” by “A file on the server”.  A new GEDCOM file is now in your kiwitrees/data/ folder.
  6. If files and folders you do not want to backup are in the list of “files and folders that will be sent to Dropbox” either:
    1. add them to field “C” as described above, so they will be excluded, or
    2. go to  Administration > Site administration> Clean up data folder and delete them.


pab » 3 Nov 2016 »

Does the backup copy every file every time it is run, or only new or changed files?


pab » 3 Nov 2016 »

I had trouble naming my app!
The names ‘kiwitrees file backup’ and ‘ktbackup’ gave an error saying the name was already in use … so does the name have to be unique in the Dropbox Universe?
I got it going with the name kt2db (sorry if anyone else wanted to use that).


kiwi » 3 Nov 2016 »

>> Does the backup copy every file every time it is run, or only new or changed files?
It only copies new or changed files, but to do so they all have to be checked, so the difference in speed is not huge.

>> …does the name have to be unique in the Dropbox Universe?
To be honest I don’t know, but those two failures suggest it is the case. I have used both of them, one for testing and one for my personal site. I asked Dropbox support and will amend the wording on this page when I get an answer.


kiwi » 3 Nov 2016 »

Just got a quick response from Dropbox support (great service!):

App names must be unique across all app names registered by other Dropbox accounts.

I’ve modified the text of this page to reflect that.

Have your say!

Have your say!