Wednesday, June 20, 2012

Mysql Replication With Phpmyadmin

First Lets go to Replication panel on XAMPP.

Screenshot at 2012-04-24 02_13_51

Next Select Configure as Master

Screenshot at 2012-04-24 02_14_03

You can configure Replication as ALL or Selective. I have done selective where I select few DBs to Replicate.

Once you are done you need to add the lines below in the my.cnf file.

# ***** Added Lines here ****
server-id=4745869
log-bin=mysql-bin
log-error=mysql-bin.err
binlog_do_db=saggezza_cats,saggezza_catstesting
# ***** Till Here ****

Here are Ignoring all the DBs for Replication except the two above.

Screenshot at 2012-04-24 02_21_40

Go to /opt/lampp/etc/my.cnf

Screenshot at 2012-04-24 02_22_11

Added the lines as I mentioned above above. Also Make sure “max_allowed_packet = 16M”

Screenshot at 2012-04-24 02_23_07

Screenshot at 2012-04-24 02_23_16

Make sure to comment out he existing server-id as we have already given above.

Screenshot at 2012-04-24 02_23_39

Restart XAMPP

$ sudo ./opt/lampp/lampp restart

Screenshot at 2012-04-24 02_24_02

Once you restart XAMPP, you can see that Mysql Server is started as Master.

Screenshot at 2012-04-24 02_24_15

Next Lets Create a Replication user and give it privileges as the slave needs this information to connect to the Master.

Screenshot at 2012-04-24 02_24_40

I have given root but you can give any username you want.

Screenshot at 2012-04-24 02_25_13

MySQL Slave Configuration

First lets add Server-id to our slave as mentioned.

server-id=9384593

Screenshot at 2012-04-24 02_28_29

Screenshot at 2012-04-24 02_29_29

Now lets connect to Master.

Screenshot at 2012-04-24 02_30_08

You will get a confirmation about he successful connection to Master.

Screenshot at 2012-04-24 02_30_20

Now we need to start SLAVE I/O and Sql Threads.

Screenshot at 2012-04-24 02_31_07

They are right under “Control Slave” as below

Screenshot at 2012-04-24 02_31_28

Now you can see the threads running.

NOTE: If you face any issues getting the threads started then please check logs. In my case IO Thread was not starting. When I checked the log I found that I had two server-id’s in the my.cnf file. Also sometimes you will get IO error due to max_allowed_packet as well, as this is by default set to 1MB, which needs to be around 16MB.

/opt/lampp/var/mysql/mysql-bin

Screenshot at 2012-04-24 02_31_37

Now we can see all the DBs in Replication Mode. Now any Updates to Master will reflect on the slave.

Screenshot at 2012-04-24 03_24_28

This will have the MASTER-SLAVE for Mysql Server is Ready.

Thursday, April 12, 2012

How to Mirror Your WordPress Blog to Blogger


wp-to-bloggerCreating a mirror of your blog is a good way to backup your content. In the event that your blog/web host/domain went down, you know that there is another site that is still running, and serving the exact same content.

This tutorial shows you how to mirror your WordPress blog to Blogger.

Why Blogger?

There are plenty of free blog services out there, why choose Blogger? The reason is because Blogger is free and is owned by Google. In term of reliability and stability, it is the best. Since you are backing up your content, isn’t it logical to get it on the most reliable platform around?

Migrating your existing WP blog

The migration from WordPress to Blogger is easy. Log into your WordPress dashboard as Administrator. Go to “Tools -> Export”. Export all your WordPress posts/categories and settings to an xml file.

wp-export-data

Go to WordPress2Blogger site. Convert the wordpress.201x-xx-xx.xml to blogger-export.xmlfile.

Login to your Blogger account and go to “Settings -> Import Blog“. Upload the blogger-export.xml file and Import your whole WP blog in.

wp-blogger-import-blog

If everything goes well, all your previously published posts should now be imported into Blogger.

Update Blogger whenever you publish a post

Now that you have imported your previously published posts into Blogger, it’s time to configure your Blogger’s blog to auto-update itself whenever you publish a post in WP.

First, in Blogger, go to “Settings -> Email & Mobile“. Create a new secret email address. This will be the email address that you mail to publish your post. Remember to check the box “Publish emails immediately”. Once done, click “Save Settings”.

wp-blogger-posting-option

Next, I am going to assume that you are using feedburner.com to manage your WP feed, and you have activated the “Email Subscription” option. What you need to do is to subscribe yourself to your own mailing list (preferably with a Gmail address) so that Feedburner can email you whenever you publish a new post.

The last and final thing is to setup your email account to forward the feedburner mail to your Blogger Publish email. In Gmail, this can be done by setting up a forwarding email address and a filter.

That’s it. Whenever you publish a new post in your WP blog, it will be auto-updated on your Blogger blog as well.

What other ways do you use to mirror your WP blog to Blogger?

-------------------------

-------------------------

Instructions

Ever wanted to move your WordPress blogs over to Blogger? This site can aid in the process!

Instructions

  1. Login to your WordPress account and navigate to the Dashboard for the blog that you'd like to transfer to Blogger.
  2. Click on the Manage tab below the Blog name.
  3. Click on the Export link below the Manage tab.
  4. Download the WordPress WXR export file by clicking on Download Export File.
  5. Save this file to your local machine.
  6. Browse to that saved document with the form below and click Convert.

  7. Save this file to your local machine. This file will be the contents of your posts/comments from WordPress in a Blogger export file.
  8. Login to your Blogger or create a new user.
  9. Once logged in, click on the Create a Blog link from the user dashboard, and then click on the Import Blog Tool
  10. Follow the instructions and upload your Blogger export file when prompted.
  11. After completing the import wizard, you should have a set of imported posts from WordPress that you can now publish to Blogger. Have fun!