File storage synchronization

Author Message

Gene Surov

Wednesday 14 October 2009 1:18:42 am

Hi,

my problem is the following: we have 2 servers: production server with Ubuntu 8.10 and development server - virtual machine with similar configuration.

I've created a simple script which synchronizes the DB (you can find it at the end of my post).

My current problem is to synchronize the uploaded files storage. I've found some mentions of cluster mode in ez publish which puts all the files (storage and cache), but I can't switch my production into this mode. Another possibility is to set up rsync, but it requires some efforts and this approach is not flexible enough. Had anyone had the same problem? Any suggestions?

!/bin/sh

date=`date +%Y%m%d%H%M%S`
filename=../sql/$date."bz2"

ssh sysuser@10.10.41.74 \
"mysqldump -udbuser -pdbpass -hproduction_db_server db_name | bzip2 -cz" \
> $filename

cd ../sql
bunzip2 $filename
mv $date db.sql

mysql -udev_db_user -pdev_db_pass dev_db < db.sql

Gaetano Giunta

Wednesday 14 October 2009 2:42:26 am

Since you already have a script for moving over the db, why not add in there 2 lines to copy over the zipped storage folder, too?

Other notes:
- add a call to ezcache.php to clean all caches after reimporting db+storage
- you might also add a call to eztc to recompile all templates (cache warmup)
- why not do a dump of the updated db (and associated storage) before overwriting it? just in case...

Of course if the copy is from prod to dev and not the other way round, the above steps can be done manually on the dev server by the developer itself...

Principal Consultant International Business
Member of the Community Project Board

Rose McMarry

Tuesday 27 October 2009 2:47:53 pm

I use a program to file synchronization, which is called File Sync. [URL="http://www.fileutilityblog.com/archives/188"]File Sync: why you need it?[/URL] May be because of its efficiency. That is why I use this program and haven't any problems. Did you use it?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 21:08:56
Script start
Timing: Jan 18 2025 21:08:56
Module start 'layout'
Timing: Jan 18 2025 21:08:56
Module start 'content'
Timing: Jan 18 2025 21:08:56
Module end 'content'
Timing: Jan 18 2025 21:08:56
Script end

Main resources:

Total runtime0.0143 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.0391152.6250
Module start 'layout' 0.00520.0023 741.664139.4453
Module start 'content' 0.00750.0041 781.109489.2891
Module end 'content' 0.01160.0025 870.398434.3047
Script end 0.0142  904.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002819.9177140.0002
Check MTime0.00139.4093140.0001
Mysql Total
Database connection0.00085.649010.0008
Mysqli_queries0.002013.842230.0007
Looping result0.00000.083610.0000
Template Total0.002215.110.0022
Template load0.00149.682010.0014
Template processing0.00085.423110.0008
Override
Cache load0.00107.136010.0010
General
dbfile0.00032.070980.0000
String conversion0.00000.043540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs