This module allows you to export and import the contents of your database
to text files containing SQL scripts. This is not the most compact or
efficient format, but it simple, reliable and portable. If you want
efficent, there are much more appropriate tools available.
A separate file is generated for each table, and each can be
imported/exported separately. Although an "import all" option is provided,
you may find that your server time limits prevent this from completing.
Files are created in the index directory, so this can be useful for
creating backups of your system. They can also be useful for transferring
data between different databases, for example, between sqlite on your home
PC and MySQL on your webserver.
**FOR MYSQL USERS ONLY**, there is also an option to convert your database
tables from latin (single byte) encoding to UTF8 (multibyte) encoding.
This change is necessary to allow the database to perform case-insensitive
searching of letters containing diacritics and non-latin character sets.
By default, PHP communicates with MySQL in latin text. When PGV sends UTF8
text to the database, MySQL treats multibyte characters as a number of
"extended ascii" characters, and converts these characters to UTF. This
incorrect encoding (and possible double-encoding) is what prevents the
database from searching data. Luckily, the reverse encodings take place
when we fetch the data back, so apart from the wasted conversion effort,
this process is transparant to PGV.
In order to use UTF8, we need to tell MySQL that we are using UTF8.
However, to do this on an existing database means that we will fetch
old/existing data using different conversions to those used to store it -
and our data will be corrupted.
We therefore need to convert our data before changing the way we talk to
MySQL. The steps to be taken are
1) export all the tables
2) convert all the tables to utf8
3) update your config.php to set $DB_UTF8_COLLATION=true;
4) import all the tables
NOTE: If your login name contains non-ascii characters, then you *may* get
logged out between steps 3 and 4. To prevent this, create an admin account
with an all-ascii username before starting.
NOTE: If you have the default MySQL configuration (latin tables and latin
communication), then steps 1 and 4 are optional. However, we can't
reliably detect this configuration, so unless you are certain, don't skip
them. Also, running step 2 repeatedly may corrupt data, meaning you do
need to run steps 1 and 4. In fact, unless you have a very good reason
(e.g. you know exactly what you are doing and have large tables on a server
with very low execution time limits), then don't skip these steps.
NOTE: If you have low server time limits, then it may not be possible to
import some of your large tables before it times out. These tables are
likely to be your gedcom-data tables. They can easily be reconstructed by
reimporting the gedcom.
NOTE: This procedure can destroy your data and prevent you from logging in.
Do not do it unless you understand what you are doing. Even if you know
what you are doing, you should make a backup before you start.
Greg Roach
Interface Improvement
None
Public
|
Date: 2009-06-23 20:04 <<It doesn't work with the latest svn (PDO)>> |
|
Date: 2009-06-23 16:54 It doesn't work with the latest svn (PDO) |
|
Date: 2009-02-10 07:07 The "not present" means that the .SQL (backup) file isn't present. |
|
Date: 2009-02-10 00:01 What is the point of the Backup column - all mine show "Not Present". |
|
Date: 2008-11-26 09:57 <<Every thing now appears to be running ok.>> |
|
Date: 2008-11-26 09:18 Greg I changed these all manually last night as I was faced with reverting |
|
Date: 2008-11-25 17:34 The Pear::DB interface that we use to connect to the database doesn't seem |
|
Date: 2008-11-25 17:22 I ran this but it only changed the table and not the fields in each table |
|
Date: 2008-11-23 21:28 I've updated the conversion script. I tried on an older MySQL database, |
|
Date: 2008-11-21 12:10 <<as this OK?>> |
|
Date: 2008-11-21 12:02 Greg, |
|
Date: 2008-11-21 08:11 <<We can probably add $DB_UTF8_COLLATION=false;>> |
|
Date: 2008-11-21 02:24 Greg, |
|
Date: 2008-11-20 20:54 <<I maintain my data out of PhpGedView, and import it.>> |
|
Date: 2008-11-20 20:36 Greg, |
| Filename | Description | Download |
|---|---|---|
| db_export.php | Updated version (conversion works better with MySQL4) | Download |
| db_export.php | Database import/export/utf8-conversion utility | Download |
| db_export.php | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| File Added | 332078: db_export.php | 2009-06-23 20:03 | fisharebest |
| File Added | 302642: db_export.php | 2008-11-23 21:28 | fisharebest |
| File Added | 302246: db_export.php | 2008-11-20 16:54 | fisharebest |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use