1c712d3bcSGreg Roach![Latest version](https://img.shields.io/github/v/release/fisharebest/webtrees?sort=semver) 20098f575SGreg Roach![Licence](https://img.shields.io/github/license/fisharebest/webtrees) 3e089a239SGreg Roach[![Unit tests](https://github.com/fisharebest/webtrees/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/fisharebest/webtrees/actions/workflows/phpunit.yaml) 43f72854bSGreg Roach[![codecov](https://codecov.io/gh/fisharebest/webtrees/branch/main/graph/badge.svg?token=zREQBP4GBs)](https://codecov.io/gh/fisharebest/webtrees) 5ca0838ccSGreg Roach[![Translation status](https://translate.webtrees.net/widgets/webtrees/-/webtrees-22/svg-badge.svg)](https://weblate.iet.open.ac.uk/projects/webtrees/webtrees-22) 643fdb97cSGreg Roach[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fisharebest/webtrees/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/fisharebest/webtrees/?branch=main) 782f63a0eSGreg Roach[![Code Climate](https://codeclimate.com/github/fisharebest/webtrees/badges/gpa.svg)](https://codeclimate.com/github/fisharebest/webtrees) 843fdb97cSGreg Roach[![StyleCI](https://github.styleci.io/repos/11836349/shield?branch=main)](https://github.styleci.io/repos/11836349?branch=main) 96ccdf4f0SGreg Roach# webtrees - online collaborative genealogy 10fac25c68SRico Sonntag 11fac25c68SRico Sonntag## Contents 12fac25c68SRico Sonntag 13fac25c68SRico Sonntag* [License](#license) 146ccdf4f0SGreg Roach* [Coding styles and standards](#coding-styles-and-standards) 15fac25c68SRico Sonntag* [Introduction](#introduction) 1626a22ad2SJustCarmen* [System requirements](#system-requirements) 17d3fe06a8SGreg Roach* [Internet browser compatibility](#browser-compatibility) 18fac25c68SRico Sonntag* [Installation](#installation) 19fac25c68SRico Sonntag* [Upgrading](#upgrading) 20bd82e704SDavid Drury* [Building and developing](#building-and-developing) 2126a22ad2SJustCarmen* [Gedcom (family tree) files](#gedcom-family-tree-files) 22fac25c68SRico Sonntag* [Security](#security) 23fac25c68SRico Sonntag* [Backup](#backup) 248b200aecSAlejandro Criado-Pérez* [Restore from Backup](#restore-from-backup) 25b4ef7f82SRico Sonntag 266ccdf4f0SGreg Roach## License 27fac25c68SRico Sonntag 28a25f0a04SGreg Roach* **webtrees: online genealogy** 29782019a1Smrqd9* Copyright 2022 webtrees development team 30fac25c68SRico Sonntag 31a25f0a04SGreg RoachThis program is free software: you can redistribute it and/or modify 32a25f0a04SGreg Roachit under the terms of the GNU General Public License as published by 33a25f0a04SGreg Roachthe Free Software Foundation, either version 3 of the License, or 34a25f0a04SGreg Roach(at your option) any later version. 35fac25c68SRico Sonntag 36a25f0a04SGreg RoachThis program is distributed in the hope that it will be useful, 37a25f0a04SGreg Roachbut WITHOUT ANY WARRANTY; without even the implied warranty of 38a25f0a04SGreg RoachMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 39a25f0a04SGreg RoachGNU General Public License for more details. 40fac25c68SRico Sonntag 41a25f0a04SGreg RoachYou should have received a copy of the GNU General Public License 42ad3143ccSGreg Roachalong with this program. If not, see <https://www.gnu.org/licenses/>. 43fac25c68SRico Sonntag 446ccdf4f0SGreg Roach## Coding styles and standards 45fac25c68SRico Sonntag 466ccdf4f0SGreg Roachwebtrees follows the [PHP Standards Recommendations](https://www.php-fig.org/psr). 476ccdf4f0SGreg Roach 486ccdf4f0SGreg Roach* [PSR-1](https://www.php-fig.org/psr/psr-1) - Basic Coding Standard 496ccdf4f0SGreg Roach* [PSR-2](https://www.php-fig.org/psr/psr-2) - Coding Style Guide 50e63974caSStefan Weil* [PSR-4](https://www.php-fig.org/psr/psr-4) - Autoloading Standard 51c692965aSGreg Roach* [PSR-6](https://www.php-fig.org/psr/psr-6) - Cache 526ccdf4f0SGreg Roach* [PSR-7](https://www.php-fig.org/psr/psr-7) - HTTP Message Interface 536ccdf4f0SGreg Roach* [PSR-11](https://www.php-fig.org/psr/psr-11) - Container Interface 54cb55cd99SGreg Roach* [PSR-12](https://www.php-fig.org/psr/psr-12) - Extended Coding Style Guide 556ccdf4f0SGreg Roach* [PSR-15](https://www.php-fig.org/psr/psr-15) - HTTP Handlers 566ccdf4f0SGreg Roach* [PSR-17](https://www.php-fig.org/psr/psr-17) - HTTP Factories 576ccdf4f0SGreg Roach 58cb55cd99SGreg RoachWe do not currently use [PSR-3 (logging)](https://www.php-fig.org/psr/psr-3) - but we plan to do so in the future. 596ccdf4f0SGreg Roach 603fd17b7aSGreg RoachFor JavaScript, we use [semistandard](https://github.com/standard/semistandard). 613fd17b7aSGreg Roach 626ccdf4f0SGreg Roach## Introduction 63fac25c68SRico Sonntag 64fac25c68SRico Sonntag**webtrees** is the web's leading online collaborative genealogy application. 65fac25c68SRico Sonntag 66fac25c68SRico Sonntag* It works from standard GEDCOM files, and is therefore compatible with every 67fac25c68SRico Sonntagmajor desktop application. 68fac25c68SRico Sonntag* It aims to to be efficient and effective by using the right combination of 69fac25c68SRico Sonntagthird-party tools, design techniques and open standards. 70fac25c68SRico Sonntag 71fac25c68SRico Sonntag**webtrees** allows you to view and edit your genealogy on your website. It has 72e667f3d4SGreg Roachfull editing capabilities, full privacy functions, and supports imedia such as 73fac25c68SRico Sonntagphotos and document images. As an online program, it fosters extended family 74fac25c68SRico Sonntagparticipation and good ancestral recording habits, as it simplifies the process 75fac25c68SRico Sonntagof collaborating with others working on your family lines. Your latest information 76fac25c68SRico Sonntagis always on your web site and available for others to see, defined by viewing 77fac25c68SRico Sonntagrules you set. For more information and to see working demos, visit 78cdc90107SGreg Roach[webtrees.net](https://webtrees.net/). 79fac25c68SRico Sonntag 80fac25c68SRico Sonntag**webtrees** is Open Source software that has been produced by people from many 81fac25c68SRico Sonntagcountries freely donating their time and talents to the project. All service, 82fac25c68SRico Sonntagsupport, and future development is dependent on the time developers are willing 83fac25c68SRico Sonntagto donate to the project, often at the expense of work, recreation, and family. 84fac25c68SRico SonntagBeyond the few donations received from users, developers receive no compensation 85fac25c68SRico Sonntagfor the time they spend working on the project. There is also no outside source 86fac25c68SRico Sonntagof revenue to support the project. Please consider these circumstances when 87fac25c68SRico Sonntagmaking support requests and consider volunteering your own time and skills to make 88fac25c68SRico Sonntagthe project even stronger and better. 89fac25c68SRico Sonntag 906ccdf4f0SGreg Roach## System requirements 91fac25c68SRico Sonntag 92fac25c68SRico SonntagTo install **webtrees**, you need: 93fac25c68SRico Sonntag 9456379645SGreg Roach* A webserver. Apache, NGINX and IIS are the most common types. To use “Pretty URLs”, you will need to configure URL rewriting" 9556379645SGreg Roach* A database. MySQL is recommended, although PostgreSQL, SQL-Server and SQLite can be used. Some features rely on MySQL for collation. Other database might not sort names according to local rules. **webtrees** uses a prefix for its table names, so you can install several instances of webtrees in the same database. 9656379645SGreg Roach* Approximately 100MB of disk space for the application files, plus whatever is 97e667f3d4SGreg Roach needed for your media files, GEDCOM files and database. 9856379645SGreg Roach* PHP 7.1 - 7.4. Servers with PHP 5.3 - 7.0 can use **webtrees** 1.7. 99fac25c68SRico Sonntag * PHP should be configured to allow sufficient server resources (memory and 100fac25c68SRico Sonntag execution time) for the size of your system. Typical requirements are: 101e667f3d4SGreg Roach * Small systems (500 individuals): 16–32 MB, 10–20 seconds 102e667f3d4SGreg Roach * Medium systems (5,000 individuals): 32–64 MB, 20–40 seconds 103e667f3d4SGreg Roach * Large systems (50,000 individuals): 64–128 MB, 40–80 seconds 1043606202eSDavid Drury 10556379645SGreg Roach## Browser compatibility 1063606202eSDavid Drury 10756379645SGreg Roach **webtrees** is tested on recent versions of popular browsers such as Edge, Firefox, 10856379645SGreg Roach Chrome, and Safari. Support for other browsers and older versions is on a case-by-case basis. 109fac25c68SRico Sonntag 1106ccdf4f0SGreg Roach## Installation 111fac25c68SRico Sonntag 1128b200aecSAlejandro Criado-Pérez1. Download the .ZIP file for latest stable version from [github.com](https://github.com/fisharebest/webtrees/releases/latest). 11356379645SGreg Roach2. Unzip the files and then upload them to an empty folder on your web server. 114fac25c68SRico Sonntag3. Open your web browser and type the URL for your **webtrees** site (for example, 115ad3143ccSGreg Roach ``https://www.yourserver.com/webtrees`` into the address bar. 11656379645SGreg Roach4. The **webtrees** setup wizard will start automatically. 117fac25c68SRico Sonntag 11856379645SGreg RoachYour first task will be to create a family tree. 119fac25c68SRico Sonntag 12056379645SGreg RoachIf you have a GEDCOM file, you can import it into the tree. If not, just start 12156379645SGreg Roachentering your family tree. 122fac25c68SRico Sonntag 12356379645SGreg RoachThere are lots of configuration options. You'll probably want to review the 124fac25c68SRico Sonntagprivacy settings first. Don't worry too much about all the other options - the 12556379645SGreg Roachdefaults are good for most people. If you get stuck, you can get friendly help 126*bc6d9c0bSPauland advice from the [help](https://www.webtrees.net/index.php/forum) forum. 127fac25c68SRico Sonntag 1286ccdf4f0SGreg Roach## Upgrading 129b4ef7f82SRico Sonntag 130fac25c68SRico SonntagUpgrading **webtrees** is quick and easy. It is strongly recommended that you 131fac25c68SRico Sonntagupgrade your installation whenever a new version is made available. Even minor 132fac25c68SRico Sonntag**webtrees** version updates usually contain a significant number of bug fixes 1333606202eSDavid Druryas well as interface improvements and program enhancements. 134fac25c68SRico Sonntag 135f0195b90SDavid Drury* **Automatic upgrade** 136f0195b90SDavid Drury 1373606202eSDavid Drury **webtrees** has an automatic upgrade facility. An administrator upon logging in 1383606202eSDavid Drurywill receive notification when a new version is available and an option to start 1393606202eSDavid Drurythe automatic upgrade. If for some reason the automatic upgrade should fail 1403606202eSDavid Drurythen a manual upgrade should be performed. 1413606202eSDavid Drury 142f0195b90SDavid Drury* **Manual upgrade** 143f0195b90SDavid Drury 144fac25c68SRico Sonntag 1. Now would be a good time to make a [backup](#backup). 145fac25c68SRico Sonntag 2. Download the latest version of **webtrees** available from 146cdc90107SGreg Roach [webtrees.net](https://webtrees.net/) 147243bf6b4SGreg Roach 3. While you are in the middle of uploading the new files, 148fac25c68SRico Sonntag a visitor to your site would encounter a mixture of new and old files. This 149b3a775f6SGreg Roach could cause unpredictable behavior or errors. To prevent this, create the 150fac25c68SRico Sonntag file **data/offline.txt**. While this file exists, visitors will see a 151243bf6b4SGreg Roach “site unavailable - come back later” message. 152fac25c68SRico Sonntag 4. Unzip the .ZIP file, and upload the files to your web server, overwriting the existing files. 1538b200aecSAlejandro Criado-Pérez 5. Delete the file **data/offline.txt**. 154fac25c68SRico Sonntag 1556ccdf4f0SGreg Roach### Note for Macintosh users 156b4ef7f82SRico Sonntag 157fac25c68SRico SonntagStep 4 assumes you are using a copy tool that **merges** directories rather than 158b3a775f6SGreg Roachreplaces them. (**Merge** is standard behavior on Windows and Linux.) If you use 159fac25c68SRico Sonntagthe Macintosh Finder or other similar tool to perform step 3, it will **replace** 160fac25c68SRico Sonntagyour configuration, media and other directories with the empty/default ones from 161fac25c68SRico Sonntagthe installation. This would be very bad (but you did take a backup in step 1, 162fac25c68SRico Sonntagdidn't you!). Further details and recommendations for suitable tools can be found 163ad3143ccSGreg Roachby searching [google.com](https://google.com). 164fac25c68SRico Sonntag 1656ccdf4f0SGreg Roach## Building and developing 166bd82e704SDavid Drury 167bd82e704SDavid DruryIf you want to build webtrees from source, or modify the code, you'll need to install 168bd82e704SDavid Drurya couple of tools first. 169bd82e704SDavid Drury 170bd82e704SDavid DruryYou will need [composer](https://getcomposer.org/) to install the PHP dependencies. 171bd82e704SDavid DruryThen run this command:: 172bd82e704SDavid Drury 173bd82e704SDavid Drury* php composer.phar install 174bd82e704SDavid Drury 175bd82e704SDavid DruryYou will need [npm](https://www.npmjs.com/get-npm) to install the Javascript dependencies. 176bd82e704SDavid DruryThen run the commands: 177bd82e704SDavid Drury 178bd82e704SDavid Drury* npm install 1799845ccc6SRico Sonntag* npm run production 180bd82e704SDavid Drury 181bd82e704SDavid DruryYou will need to re-run the second of these any time you modify the file `webtrees.js`. 182fac25c68SRico Sonntag 1836ccdf4f0SGreg Roach## Gedcom (family tree) files 184fac25c68SRico Sonntag 18556379645SGreg RoachWhen you import a family tree (GEDCOM) file in **webtrees** the 1863606202eSDavid Drurydata from the file is transferred to the database tables. The file itself 187f0195b90SDavid Druryremains in the **webtrees/data** folder and is no longer used or required 188f0195b90SDavid Druryby **webtrees**. Any subsequent editing of the **webtrees** data 1893606202eSDavid Drurywill not change this file 190fac25c68SRico Sonntag 191fac25c68SRico SonntagWhen or if you change your genealogy data outside of **webtrees**, it is not 192fac25c68SRico Sonntagnecessary to delete your GEDCOM file or database from **webtrees** and start 193fac25c68SRico Sonntagover. Follow these steps to update a GEDCOM that has already been imported: 194fac25c68SRico Sonntag 1953606202eSDavid Drury* Go to ``Control panel`` -> ``Manage family trees`` On the line relating to this particular family tree (GEDCOM) 1963606202eSDavid Drury file (or a new one) select IMPORT. 197243bf6b4SGreg Roach* Take careful note of the media items option (_“If you have created media objects 198ed1bbedbSGreg Roach in **webtrees**, and have edited your data off-line using software that 199fac25c68SRico Sonntag deletes media objects, then tick this box to merge the current media objects 200243bf6b4SGreg Roach with the new GEDCOM.”_) In most cases you should leave this box **UNCHECKED**. 201243bf6b4SGreg Roach* Click “SAVE”. **webtrees** will validate the GEDCOM again before importing. 202fac25c68SRico Sonntag During this process, **webtrees** copies your entire family tree (GEDCOM file) 203fac25c68SRico Sonntag to a 'chunk' table within your database. Depending on the coding of your file, 204fac25c68SRico Sonntag its file size and the capabilities of your server and the supporting software, 205fac25c68SRico Sonntag this may take some time. **No progress bar will show while the data is being 206fac25c68SRico Sonntag copied** and should you navigate away from this page, the process is suspended. 207fac25c68SRico Sonntag It will start again when you return to the Family Tree management page. 208fac25c68SRico Sonntag 2096ccdf4f0SGreg Roach## Security 210fac25c68SRico Sonntag 211fac25c68SRico Sonntag**Security** in _webtrees_ means ensuring your site is safe from unwanted 212fac25c68SRico Sonntagintrusions, hacking, or access to data and configuration files. The developers 213fac25c68SRico Sonntagof _webtrees_ regard security as an extremely important part of its development 214fac25c68SRico Sonntagand have made every attempt to ensure your data is safe. 215fac25c68SRico Sonntag 2163606202eSDavid DruryThe area most at risk of intrusion would be the **/data** folder that contains your 217fac25c68SRico Sonntagconfig.ini.php file, and various temporary files. If you are concerned there 218bd82e704SDavid Drurymay be a risk there is a very simple test you can do: try to fetch the file 219bd82e704SDavid Druryconfig.ini.php by typing **``url_to_your_server/data/config.ini.php``** in your web 220fac25c68SRico Sonntagbrowser. 221fac25c68SRico Sonntag 222243bf6b4SGreg RoachThe most likely result is an “access denied” message like this: 223fac25c68SRico Sonntag 224fac25c68SRico Sonntag Forbidden 225fac25c68SRico Sonntag 226f0195b90SDavid Drury You don't have permission to access /data/config.ini.php on this server. 227fac25c68SRico Sonntag 228fac25c68SRico SonntagThis indicates that the protection built into **webtrees** is working, and no 229fac25c68SRico Sonntagfurther action is required. 230fac25c68SRico Sonntag 231fac25c68SRico SonntagIn the unlikely event you do fetch the file (you will just see a semicolon), 232fac25c68SRico Sonntagthen that protection is not working on your site and you should take some further 233fac25c68SRico Sonntagaction. 234fac25c68SRico Sonntag 2353606202eSDavid DruryIf your server runs PHP in CGI mode, then change the permission of the **/data** 2363606202eSDavid Druryfolder to 700 instead of 777. This will block access to the httpd process, 237fac25c68SRico Sonntagwhile still allowing access to PHP scripts. 238fac25c68SRico Sonntag 239fac25c68SRico SonntagThis will work for perhaps 99% of all users. Only the remaining 1% should consider 2403606202eSDavid Drurythe most complex solution, moving the **/data** folder out of accessible web 241fac25c68SRico Sonntagspace. (**_Note:_** In many shared hosting environments this is not an option anyway.) 242fac25c68SRico Sonntag 243fac25c68SRico SonntagIf you do find it necessary, following is an example of the process required: 244fac25c68SRico Sonntag 2453606202eSDavid DruryIf your home folder is something like **/home/username**, 2463606202eSDavid Druryand the root folder for your web site is **/home/username/public_html**, 2473606202eSDavid Druryand you have installed **webtrees** in the **public_html/webtrees** folder, 2483606202eSDavid Drurythen you would create a new **data** folder in your home folder at the same 2493606202eSDavid Drurylevel as your public_html folder, such as **/home/username/private/data**, 250fac25c68SRico Sonntagand place your GEDCOM (family tree) file there. 251fac25c68SRico Sonntag 2523606202eSDavid DruryThen change the **Data folder** setting on the ``Control panel`` -> 2533606202eSDavid Drury``Website`` -> ``Website preferences`` page from the default **data/** to the new 254fac25c68SRico Sonntaglocation **/home/username/private/data** 255fac25c68SRico Sonntag 256fac25c68SRico SonntagYou will have **two** data directories: 257fac25c68SRico Sonntag 258fac25c68SRico Sonntag* [path to webtrees]/data - just needs to contain config.ini.php 259fac25c68SRico Sonntag* /home/username/private/data - contains everything else 260fac25c68SRico Sonntag 2616ccdf4f0SGreg Roach## Backup 262fac25c68SRico Sonntag 263fac25c68SRico SonntagBackups are good. Whatever problem you have, it can always be fixed from a good 264fac25c68SRico Sonntagbackup. 265fac25c68SRico Sonntag 2663606202eSDavid DruryTo make a backup of **webtrees**, you need to make a copy of the following 267fac25c68SRico Sonntag 2683606202eSDavid Drury1. The files in the *webtrees/data* folder. 269e3ca0f87SAlejandro Criado-Pérez2. The tables in the database. Freely available tools such as 270e3ca0f87SAlejandro Criado-Pérez [phpMyAdmin](https://www.phpmyadmin.net) allow you to do this in one click. Alternatively, You can also make a backup running a mysqldump command (just replace the words *[localhost]*, *[username]*, *[password]* and *[databasename]* with your own): 271e3ca0f87SAlejandro Criado-Pérez 272e3ca0f87SAlejandro Criado-Pérez `mysqldump --host=[localhost] -u [username] -p[password] --databases [databasename] > dump_file.sql` 273e3ca0f87SAlejandro Criado-Pérez 274e3ca0f87SAlejandro Criado-Pérez Note that '*-p[password]*' goes together with no space in between. 275e3ca0f87SAlejandro Criado-Pérez 276fac25c68SRico SonntagRemember that most web hosting services do NOT backup your data, and this is 277fac25c68SRico Sonntagyour responsibility. 278e3ca0f87SAlejandro Criado-Pérez 279e3ca0f87SAlejandro Criado-Pérez## Restore from backup 280e3ca0f87SAlejandro Criado-Pérez 281e3ca0f87SAlejandro Criado-PérezTo restore a backup on a new server: 282e3ca0f87SAlejandro Criado-Pérez 283e3ca0f87SAlejandro Criado-Pérez1. Follow the steps in [Installation](#installation) to get a clean new installation. 284e3ca0f87SAlejandro Criado-Pérez 285e3ca0f87SAlejandro Criado-Pérez2. Replace the *data* folder with backup copy. 286e3ca0f87SAlejandro Criado-Pérez 287e3ca0f87SAlejandro Criado-Pérez3. Restore your mysql database using phpmyadmin or running the following command line on your database server using your mysqldumpfile (just replace the words *[username]*, *[password]* and *[databasename]* with your own): 288e3ca0f87SAlejandro Criado-Pérez 289e3ca0f87SAlejandro Criado-Pérez `mysql -u [username] -p[password] [database_name] < [dump_file.sql]` 290e3ca0f87SAlejandro Criado-Pérez 291e3ca0f87SAlejandro Criado-Pérez4. Confirm the file *data/config.ini.php* contains to correct information to connect to the database and update it if needed. 292