MyBB Community Forums

Full Version: [Tutorial] Sync your users with another MyBB board
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
EDIT: I have this user sync up and running on test sites, & it is actually very easy*.
* Very easy depends on your acquired skills and general experience.

#
New forum --> Another New Forum  (Good)
Older forum --> New Forum  (Good)

Older forum --> Another Established forum (First merge users w/ MyBB merge system, then start using sync)
  • Feel free to ask questions
  • Some "semi-obvious details" are left out (i.e. You need to re-direct new registrations towards your "Master forum", away from the others)
  • Make back ups, before trying your first sync.
  • Note: Updates do not need to be every 20 minutes; I choose that to insure low server load. You could update every minute or two if you want.
###

Hi,
This simple method works on any type of Linux hosting.
  • Your users can reg at one forum, and automatically be registered at your other forum(s)  Smile

#
Sync your users with another MyBB board

1) Download the latest version of SQLyog Job Agent (SJA) for Linux
Edit (Original source / shutting down?) >>      http://code.google.com/p/sqlyog/downloads/list
This source is a "package" / Need to find a single file called "SQLyog Job Agent (SJA) for Linux"   https://github.com/webyog/sqlyog-community

2) Look at sample file ' sja-sample2 '  

3) Edit out
<tunnelinfo type="http">
<url>http://www.yourdomain.com/SQLyogTunnel.php</url>
</tunnelinfo>
...unless you need to use a http tunnel.

4) Modify the sja-sample2 for your databases, host, etc.
Also modify this part
<tables all="no">
<table>
<name>`columns_priv`</name>
<columns all="yes" />
</table>
<table>
<name>`db`</name>
<columns all="no">
<column>`Host`</column>
<column>`Db`</column>
<column>`User`</column>
</columns>
</table>
<table>
<name>`host`</name>
<columns all="yes" />
<sqlwhere>host like '%%'</sqlwhere></table>
</tables>

Change to (for example)

<tables all="no">
<table>
<name>`mybb_users`</name>
<columns all='no'>
<column>language</column>
<column>longlastip</column>
<column>longregip</column>
<column>lastip</column>
<column>regip</column>
<column>referrer</column>
<column>awayreason</column>
<column>returndate</column>
<column>awaydate</column>
<column>away</column>
<column>ignorelist</column>
<column>buddylist</column>
<column>dst</column>
<column>timezone</column>
<column>timeformat</column>
<column>dateformat</column>
<column>showavatars</column>
<column>showsigs</column>
<column>remember</column>
<column>hideemail</column>
<column>birthdayprivacy</column>
<column>birthday</column>
<column>msn</column>
<column>yahoo</column>
<column>aim</column>
<column>icq</column>
<column>website</column>
<column>regdate</column>
<column>usertitle</column>
<column>displaygroup</column>
<column>additionalgroups</column>
<column>usergroup</column>
<column>avatardimensions</column>
<column>avatar</column>
<column>email</column>
<column>salt</column>
<column>password</column>
<column>username</column>
<column>uid</column>
</columns>
</table>
</tables>
**

** Avoid syncing some columns like 'postnum', 'lastvisit', 'lastpost', etc.

Note: This sample file is an xml file, so save as filename.xml


EDIT:
<column>avatardimensions</column>
<column>avatar</column>
^^^
Avatars:
A) Edit out that (small) section to avoid syncing avatars,
...or...
B) Use rsync to sync the ( ./upload/avatars/) files, while this tut helps sync the database part.

##

Cron job  (Note: Can be done more frequently if you want. Server load is trivial on a decent VPS, but might be a problem on cheap shared hosting)
10,30,50 * * * * "/var/scripts/sja/sja" "/var/scripts/sja/mydomain.com.xml" >/dev/null 2>&1

Notes:
* Set the permissions on sja/sja to 755
* FYI: sja/sja is a file (w/ no extension), not a folder
* This will work on cPanel, VPS, Dedi, etc.
For cPanel just adjust your file paths.


Now you can Sync your users with another MyBB board  Smile
Does this work both ways? Like if I register on forum a it syncs to forum b and registering on forum b syncs to forum a?
LOL! Thanks seeker. Smile
You are simply amazing Seeker!
FYI --> New Edits Added to the OP:

EDIT #1:
<column>avatardimensions</column>
<column>avatar</column>
^^^
Avatars:
A) Edit out that (small) section to avoid syncing avatars,
...or...
B) Use rsync to sync the ( ./upload/avatars/) files, while this tut helps sync the database part.

##

EDIT #2:
I have this user sync up and running on test sites, & it is actually very easy.
#
New forum --> Another New Forum (Good)
Older forum --> New Forum (Good)

Older forum --> Another Established forum (First merge users w/ MyBB merge system, then start using sync)
  • Feel free to ask questions
  • Some "semi-obvious details" are left out (i.e. You need to re-direct new registrations towards your "Master forum", away from the others)
  • Make back ups, before trying your first sync. Angel

###




(2010-10-22, 03:51 PM)meridianblade Wrote: [ -> ]Does this work both ways? Like if I register on forum a it syncs to forum b and registering on forum b syncs to forum a?

The examples here are primarily for one-way sync.
SQLyog Job Agent (SJA) for Linux can do two-way, but you still have to choose which one is master in case of a conflict.


(2010-10-24, 03:14 AM)Valaki Wrote: [ -> ]LOL! Thanks seeker. Smile

You are welcome Smile

(2010-10-24, 03:35 AM)Mark.M Wrote: [ -> ]You are simply amazing Seeker!

Wow, thanks Mark Blush
I traslate it in Italian very important tutorial Big Grin
Wow. Amazing tutorial. I was about to ask this question in forum.

Going to test it tomorrow on test boards.
just so everyone realizes, this is only to sync user accounts upon registration and does not cover logging in, etc. It is also not an immediate solution as its cron based and will only run at the times you specify. This means that when a user registers on one board, it can take up to 20 minutes for that users to show up on the other board (given the cron setup posted above)

this post is not meant to discourage the use of this pretty cool tutorial. i may use this tut as a base for some other things on my own sites, but i wanted to be clear of what the expectations should be.
will it sync the users on two different boards? member registered at site "a" will be added to the site "b" users base after the specified cron job time?
(2010-10-30, 07:14 PM)1master1 Wrote: [ -> ]will it sync the users on two different boards? member registered at site "a" will be added to the site "b" users base after the specified cron job time?

That's what this tutorial is all about.
Pages: 1 2 3