[TYPO3] Offline replication and duplicate entry error at sql import

Vito Robar vito.robar at mors.si
Wed Apr 19 09:05:27 CEST 2006


we use typo3 3.8.0, running on hp-ux AMP (mysql 4.1). We have two 
exactly the same installations:
- one internal, where the contents is created, edited, uptdated etc.
- one external, connected to internet where the contents is just 
displayed. BE is disabled there.

Important note: internal and external server are not connected in any
way, there is air gap between them.

We want to replicate contents from internal typo3 site to external site, 
exact copy. Because the two servers are disconnected, we can't use mysql 
replication maechanisms.

We already are doing replication this way:
1. Full export of typo3 database (mysqldump --opt)
2. Collect *ALL* modified files from typo3 folder, including folders 
fileadmin, uploads, typo3temp (tar + gzip)
3. Copy files 1-2 to removable media and transfer them to the same 
folders on external server.
4. Database import; while importing, tables are deleted and created from 
scratch (--opt automatically inserts drop/create table sql statements).

The task above is automated as much as possible, so user is responsible 
just for file transfer.

We don't use typo3's export/import module, because is cumbersome and
can't be automated (shell scripts).

The problem/question:
Sometimes we get SQL error at import:
ERROR 1062 (X) at line Y: Duplicate entry 'e0eb053dd06...' for key 1

This error ocurred while updating table cache_imagesizes.

Obviously, typo3 is generating some data in database even when external 
users are just browsing the site. While importing data, there is collision.
When investigated further, I noticed that tables cache_hash, cache_pages
and cache_pagesection kept changing at external server.
If the http server is not running while database import, there is no 
error. So temporary solution is that import script shuts the http server 
off before sql import. But, I would rather not to stop the whole server, 
because we also deliver other, non typo3 contents.

The question is:
Can I omit tables cache_* from database export?
Are there any other tables which can be omited also?
Is there any other mechanism for replication besides export/import 
module and which can be automated?


More information about the TYPO3-english mailing list