Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.2. Users manual

Installation

The installation of this extension is very simple. Just connect to the Typo3 Extension Repository and download «DB Sync» (dbsync), located in the backend module section. Note that you will also need to download the «Developer API» extension (api_macmade), as it will be needed by the module.

Once the extension is installed, you'll notice a new element in the left menu, under the tool section.

Synchronizing tables

The first function of the backend module allows you to synchronize two different tables inside the same database. This can be useful in a lot of contexts, like switching from an extension to an other without loosing existing content. In the examples below, we will be synchronizing the backend users with the frontend users.

The first thing to do is to select the tables to use. You first have to select a source table (on the left). This is the table where the records are coming from. Then, just select a destination table (on the right). This is were the records from the other table will go.

Then, you need to map the fields of those two tables. The program will try to create the mapping for you, by checking the names of the fields, but you can also map the tables by hand, with the help of the selector boxes. On the right column, you'll see all the available fields of the destination table. You can then map each field with one from the source table.

Once you're done with the mapping, you can choose between some options, which will affect the way the records are imported in the destination table.

First, you can choose either to add the source records to the destination table, or to empty the destination table before the importation. With the first method, the existing records on the destination table will be preserved.

You also have to choose a destination page for the imported records, with the help of the selector box representing the site tree.

You can then choose to import only some records. If you don't select specific records in the select box, then the whole table will be imported. By default, the records marked as deleted in the database won't be imported, but you can always choose this with the checkbox just below.

Synchronizing databases

The second function of the module allows you to synchronize two different databases. This can be very helpful if you have, for instance, a production (public) website and a development website. You can do everything on the development website, so you don't risk to take the production site down, and then you just need to sync the two databases to publish your changes on the public site.

The first step is to connect to a database server, by providing a username, password, and host.

Once you're connected to the external database server, you'll see a list of the databases the user has access to. Just select one in order to synchronize.

You'll then see all the tables which are present on both databases. You can choose either to add the records from the external tables to the local tables, or the erase the local tables before importing the external records. With this last setting, you'll get an exact copy of the external database.

Be careful when you sync databases, and backup your data before proceeding.