xref: /webtrees/README.md (revision e3c147d0d53873311b7c137c41b4439e01d4189e)
1![Latest version)](https://img.shields.io/github/v/release/fisharebest/webtrees?sort=semver)
2![Licence](https://img.shields.io/github/license/fisharebest/webtrees)
3[![Build Status](https://travis-ci.org/fisharebest/webtrees.svg?branch=master)](https://travis-ci.org/fisharebest/webtrees)
4[![Coverage Status](https://coveralls.io/repos/github/fisharebest/webtrees/badge.svg?branch=master)](https://coveralls.io/github/fisharebest/webtrees?branch=master)
5[![Translation status](https://weblate.iet.open.ac.uk/widgets/webtrees/-/svg-badge.svg)](https://weblate.iet.open.ac.uk/projects/webtrees/webtrees/)
6[![SensioLabsInsight](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de/mini.png)](https://insight.sensiolabs.com/projects/78a5ba19-7ddf-4a58-8262-1c8a149f38de)
7[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fisharebest/webtrees/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fisharebest/webtrees/?branch=master)
8[![Code Climate](https://codeclimate.com/github/fisharebest/webtrees/badges/gpa.svg)](https://codeclimate.com/github/fisharebest/webtrees)
9[![StyleCI](https://github.styleci.io/repos/11836349/shield?branch=master)](https://github.styleci.io/repos/11836349)
10
11# webtrees - online collaborative genealogy
12
13The project’s website is [www.webtrees.net](https://www.webtrees.net).
14Further documentation is available at [wiki.webtrees.net](https://wiki.webtrees.net) and [webtrees.github.io](https://webtrees.github.io).
15
16## Contents
17
18* [License](#license)
19* [Coding styles and standards](#coding-styles-and-standards)
20* [Introduction](#introduction)
21* [System requirements](#system-requirements)
22* [Internet browser compatibility](#internet-browser-compatibility)
23* [Installation](#installation)
24* [Upgrading](#upgrading)
25* [Building and developing](#building-and-developing)
26* [Gedcom (family tree) files](#gedcom-family-tree-files)
27* [Security](#security)
28* [Backup](#backup)
29
30
31## License
32
33* **webtrees: online genealogy**
34* Copyright 2019 webtrees development team
35
36This program is free software: you can redistribute it and/or modify
37it under the terms of the GNU General Public License as published by
38the Free Software Foundation, either version 3 of the License, or
39(at your option) any later version.
40
41This program is distributed in the hope that it will be useful,
42but WITHOUT ANY WARRANTY; without even the implied warranty of
43MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44GNU General Public License for more details.
45
46You should have received a copy of the GNU General Public License
47along with this program. If not, see <http://www.gnu.org/licenses/>.
48
49## Coding styles and standards
50
51webtrees follows the [PHP Standards Recommendations](https://www.php-fig.org/psr).
52
53* [PSR-1](https://www.php-fig.org/psr/psr-1) - Basic Coding Standard
54* [PSR-2](https://www.php-fig.org/psr/psr-2) - Coding Style Guide
55* [PSR-4](https://www.php-fig.org/psr/psr-4) - Autoloading Stardard
56* [PSR-6](https://www.php-fig.org/psr/psr-6) - Cache
57* [PSR-7](https://www.php-fig.org/psr/psr-7) - HTTP Message Interface
58* [PSR-11](https://www.php-fig.org/psr/psr-11) - Container Interface
59* [PSR-12](https://www.php-fig.org/psr/psr-12) - Extended Coding Style Guide
60* [PSR-15](https://www.php-fig.org/psr/psr-15) - HTTP Handlers
61* [PSR-17](https://www.php-fig.org/psr/psr-17) - HTTP Factories
62
63We do not currently use [PSR-3 (logging)](https://www.php-fig.org/psr/psr-3) - but we plan to do so in the future.
64
65## Introduction
66
67**webtrees** is the web's leading online collaborative genealogy application.
68
69* It works from standard GEDCOM files, and is therefore compatible with every
70major desktop application.
71* It aims to to be efficient and effective by using the right combination of
72third-party tools, design techniques and open standards.
73
74**webtrees** allows you to view and edit your genealogy on your website. It has
75full editing capabilities, full privacy functions, and supports imedia such as
76photos and document images. As an online program, it fosters extended family
77participation and good ancestral recording habits, as it simplifies the process
78of collaborating with others working on your family lines. Your latest information
79is always on your web site and available for others to see, defined by viewing
80rules you set. For more information and to see working demos, visit
81[webtrees.net](https://webtrees.net/).
82
83**webtrees** is Open Source software that has been produced by people from many
84countries freely donating their time and talents to the project. All service,
85support, and future development is dependent on the time developers are willing
86to donate to the project, often at the expense of work, recreation, and family.
87Beyond the few donations received from users, developers receive no compensation
88for the time they spend working on the project. There is also no outside source
89of revenue to support the project. Please consider these circumstances when
90making support requests and consider volunteering your own time and skills to make
91the project even stronger and better.
92
93
94## System requirements
95
96To install **webtrees**, you need:
97
98* A webserver. Apache, NGINX and IIS are the most common types. To use “Pretty URLs”, you will need to configure URL rewriting"
99* 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.
100* Approximately 100MB of disk space for the application files, plus whatever is
101  needed for your media files, GEDCOM files and database.
102* PHP 7.1 - 7.4.  Servers with PHP 5.3 - 7.0 can use **webtrees** 1.7.
103   * PHP should be configured to allow sufficient server resources (memory and
104     execution time) for the size of your system. Typical requirements are:
105      * Small systems (500 individuals): 16–32 MB, 10–20 seconds
106      * Medium systems (5,000 individuals): 32–64 MB, 20–40 seconds
107      * Large systems (50,000 individuals): 64–128 MB, 40–80 seconds
108
109## Browser compatibility
110
111  **webtrees** is tested on recent versions of popular browsers such as Edge, Firefox,
112  Chrome, and Safari.  Support for other browsers and older versions is on a case-by-case basis.
113
114## Installation
115
1161. Download the .ZIP file for latest stable version from [github.com](https://github.com/fisharebest/webtrees/releases/latest)
1172. Unzip the files and then upload them to an empty folder on your web server.
1183. Open your web browser and type the URL for your **webtrees** site (for example,
119   ``http://www.yourserver.com/webtrees`` into the address bar.
1204. The **webtrees** setup wizard will start automatically.
121
122Your first task will be to create a family tree.
123
124If you have a GEDCOM file, you can import it into the tree.  If not, just start
125entering your family tree.
126
127There are lots of configuration options. You'll probably want to review the
128privacy settings first. Don't worry too much about all the other options - the
129defaults are good for most people. If you get stuck, you can get friendly help
130and advice from the [help](https://webtrees.net/forums) forum.
131
132
133## Upgrading
134
135Upgrading **webtrees** is quick and easy. It is strongly recommended that you
136upgrade your installation whenever a new version is made available. Even minor
137**webtrees** version updates usually contain a significant number of bug fixes
138as well as interface improvements and program enhancements.
139
140* **Automatic upgrade**
141
142  **webtrees** has an automatic upgrade facility. An administrator upon logging in
143will receive notification when a new version is available and an option to start
144the automatic upgrade. If for some reason the automatic upgrade should fail
145then a manual upgrade should be performed.
146
147* **Manual upgrade**
148
149  1. Now would be a good time to make a [backup](#backup).
150  2. Download the latest version of **webtrees** available from
151   [webtrees.net](https://webtrees.net/)
152  3. While you are in the middle of uploading the new files,
153   a visitor to your site would encounter a mixture of new and old files.  This
154   could cause unpredictable behavior or errors.  To prevent this, create the
155   file **data/offline.txt**.  While this file exists, visitors will see a
156   “site unavailable - come back later” message.
157  4. Unzip the .ZIP file, and upload the files to your web server, overwriting the existing files.
158  5. Delete the file **data/offline.txt**
159
160
161### Note for Macintosh users
162
163Step 4 assumes you are using a copy tool that **merges** directories rather than
164replaces them. (**Merge** is standard behavior on Windows and Linux.) If you use
165the Macintosh Finder or other similar tool to perform step 3, it will **replace**
166your configuration, media and other directories with the empty/default ones from
167the installation. This would be very bad (but you did take a backup in step 1,
168didn't you!). Further details and recommendations for suitable tools can be found
169by searching [google.com](http://google.com).
170
171
172## Building and developing
173
174If you want to build webtrees from source, or modify the code, you'll need to install
175a couple of tools first.
176
177You will need [composer](https://getcomposer.org/) to install the PHP dependencies.
178Then run this command::
179
180* php composer.phar install
181
182You will need [npm](https://www.npmjs.com/get-npm) to install the Javascript dependencies.
183Then run the commands:
184
185* npm install
186* npm run production
187
188You will need to re-run the second of these any time you modify the file `webtrees.js`.
189
190## Gedcom (family tree) files
191
192When you import a family tree (GEDCOM) file in **webtrees** the
193data from the file is transferred to the database tables. The file itself
194remains in the **webtrees/data** folder and is no longer used or required
195by **webtrees**. Any subsequent editing of the **webtrees** data
196will not change this file
197
198When or if you change your genealogy data outside of **webtrees**, it is not
199necessary to delete your GEDCOM file or database from **webtrees** and start
200over. Follow these steps to update a GEDCOM that has already been imported:
201
202* Go to ``Control panel`` -> ``Manage family trees`` On the line relating to this particular family tree (GEDCOM)
203  file (or a new one) select IMPORT.
204* Take careful note of the media items option (_“If you have created media objects
205  in **webtrees**, and have edited your data off-line using software that
206  deletes media objects, then tick this box to merge the current media objects
207  with the new GEDCOM.”_) In most cases you should leave this box **UNCHECKED**.
208* Click “SAVE”. **webtrees** will validate the GEDCOM again before importing.
209  During this process, **webtrees** copies your entire family tree (GEDCOM file)
210  to a 'chunk' table within your database. Depending on the coding of your file,
211  its file size and the capabilities of your server and the supporting software,
212  this may take some time. **No progress bar will show while the data is being
213  copied** and should you navigate away from this page, the process is suspended.
214  It will start again when you return to the Family Tree management page.
215
216
217### Gedcom file Formats
218
219Every Family History program has its own method of creating GEDCOM files, and
220differing output format options to select from. **webtrees'** import routines
221can read many different formats, but not necessarily all. If your software has
222a “UTF8” option you should always use that. However, **webtrees** has been
223tested with these alternative formats:
224
225* ANSI
226   * imports OK, but is slow due to the translation into UTF8 as part
227     of the import process.
228* MAC
229   * imports OK, but is slow due to the translation into UTF8 as part
230     of the import process.
231* DOS
232   * imports OK, but is slow due to the translation into UTF8 as part
233     of the import process.
234* ANSEL
235   * currently will not import. Gives warning *Error: cannot convert
236     GEDCOM file from ANSEL encoding to UTF-8 encoding*. Later releases
237     of **webtrees** may include the facility to translate from ANSEL to UTF8,
238     but for now a standalone utility [is available here](https://dev.webtrees.net/ansel/)
239     and should be used to convert the format to UTF-8 prior to importing.
240
241
242## Security
243
244**Security** in _webtrees_ means ensuring your site is safe from unwanted
245intrusions, hacking, or access to data and configuration files. The developers
246of _webtrees_ regard security as an extremely important part of its development
247and have made every attempt to ensure your data is safe.
248
249The area most at risk of intrusion would be the **/data** folder that contains your
250config.ini.php file, and various temporary files. If you are concerned there
251may be a risk there is a very simple test you can do: try to fetch the file
252config.ini.php by typing **``url_to_your_server/data/config.ini.php``** in your web
253browser.
254
255The most likely result is an “access denied” message like this:
256
257    Forbidden
258
259    You don't have permission to access /data/config.ini.php on this server.
260
261This indicates that the protection built into **webtrees** is working, and no
262further action is required.
263
264In the unlikely event you do fetch the file (you will just see a semicolon),
265then that protection is not working on your site and you should take some further
266action.
267
268If your server runs PHP in CGI mode, then change the permission of the **/data**
269folder to 700 instead of 777. This will block access to the httpd process,
270while still allowing access to PHP scripts.
271
272This will work for perhaps 99% of all users. Only the remaining 1% should consider
273the most complex solution, moving the **/data** folder out of accessible web
274space. (**_Note:_** In many shared hosting environments this is not an option anyway.)
275
276If you do find it necessary, following is an example of the process required:
277
278If your home folder is something like **/home/username**,
279and the root folder for your web site is **/home/username/public_html**,
280and you have installed **webtrees** in the **public_html/webtrees** folder,
281then you would create a new **data** folder in your home folder at the same
282level as your public_html folder, such as **/home/username/private/data**,
283and place your GEDCOM (family tree) file there.
284
285Then change the **Data folder** setting on the ``Control panel`` ->
286``Website`` -> ``Website preferences`` page from the default **data/** to the new
287location **/home/username/private/data**
288
289You will have **two** data directories:
290
291* [path to webtrees]/data - just needs to contain config.ini.php
292* /home/username/private/data - contains everything else
293
294
295## Backup
296
297Backups are good. Whatever problem you have, it can always be fixed from a good
298backup.
299
300To make a backup of **webtrees**, you need to make a copy of the following
301
3021. The files in the *webtrees/data* folder.
3032. The files in the *webtrees/media* folder.
3043. The tables in the database. Freely available tools such as
305   [phpMyAdmin](http://www.phpmyadmin.net) allow you to do this in one click.
306
307Remember that most web hosting services do NOT backup your data, and this is
308your responsibility.
309