<div dir="ltr"><div dir="ltr">On Tue, 11 May 2021 at 19:53, IT Technical Analyst FOD <<a href="mailto:fo.ittechnicalanalyst@emergency.it" target="_blank">fo.ittechnicalanalyst@emergency.it</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="IT">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I don’t understand very well why you need a dump of the db; if you use that for having 2 databases with exactly the same
 data, then I would proceed like that:<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>1.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Dump database A<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>2.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Import dump into target database B<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>3.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Add your source db to bucardo (bucardo add db A, with tables etc)<br>
</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New"">bucardo add db db_A dbhost=myhost dbport=5432 dbname=mydbname dbuser=mydbuser dbpass=mydbpassword</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>4.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Add your target db to bucardo (bucardo add db B, with tables etc)<br>
</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New"">bucardo add db db_B dbhost=myhost_B dbport=5432 dbname=mydbname dbuser=mydbuser dbpass=mydbpassword</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>5.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Create a sync that has:<u></u><u></u></span></p>
<p style="margin-left:72pt">
<u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>a.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">database A as source, database B as target if you want a master to slave replication<br>
</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New"">bucardo add dbgroup grp_m2s_mydbname db_A:source db_B:target<br>
bucardo add sync sync_mydbname_m2s dbs=grp_m2s_mydbname [‘tables=’]</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p style="margin-left:72pt">
<u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>b.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">both databases as source if you want a master to master replication (you should choose a conflit resolution
 strategy,  I use “<i>bucardo_latest</i>”)<br>
</span><span lang="EN-US" style="font-size:10pt;font-family:"Courier New"">bucardo add dbgroup grp_m2m_mydbname db_A:source db_B:source<br>
bucardo add sync sync_mydbname_m2m dbs=grp_m2m_mydbname conflict_strategy=bucardo_latest [‘tables=’]</span><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">More precisely I created a dbgroup with both databases, and then I add that dbgroup to the sync.<br>
The “tables” parameter is optional, to specify a subset of tables to be replicated.<u></u><u></u></span></p>
<p><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><span>6.<span style="font:7pt "Times New Roman"">      
</span></span></span><u></u><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Start bucardo</span></p></div></div></blockquote><div><br></div><div>Yep, that makes sense! I was actually setting up bucardo (adding DB, tables, sequence, sync, etc) prior dumping and restoring the DB in the target... but the way you do it is the same way Frank does it, as per his emails... so that's great. That's what I was looking for.</div><div><br></div><div>Cheers!</div></div></div>