blogging

Recovering from Lost AWS EC2 Key

This article is for AWS users using EC2 instances.
Summary: Please backup your AWS EC2 Key file and you will never have to go through below pain 🙂

AWS allows you to create a key-pair which can be downloaded on your machine and it is used for logging into your EC2 instance.
I had been using the same for accessing the EC2 instance for this blog. But last week my corporate laptop was upgraded and I took backup of all files except this key file.

I didnt realize this until saturday when I wanted to login to my EC2 instance. When I couldn’t find the file, I thought of downloading it again from AWS console.
But it was no where to be found. I searched and found out that we can’t download this file again.

Only solution to this problem is to create new EC2 instance with new key pair and then move site . I have documented high level tasks which can be used to restore. These steps are performed on AWS micro instance and its assumed that all your files are lying on EBS volume. My earlier article on AWS setup can be used for configuring EC2 instance.

1. Create new ec2 instance with new key-pair and make multiple backup copies of this key file and store at multiple location. Next install apache,php,mysql or any other component required for your site. Its better to create EC2 instance in same region as your old instance like us-east-1a.
2. Assign new elastic ip address to this EC2 instance.
3. If your site is working then you can login to wordpress panel and take mysql backup which can be restored to the new ec2 instance. I use WP-DBManager plugin for mysql backups.
4. Next take snapshot of your existing ec2 volume (hosting blog document directory) . This has to be done via EC2 dashboard ->Elastic Block Store ->Snapshots .This has to be in same region as new EC2 instance as we will be mounting the volume. On completion of snapshot, create a new volume out of this snapshot.
5. We need to attach this volume to new EC2 instance.  Go to EC2 dashboard ->Elastic Block Store ->Volumes. Choose the new volume and actions->attach volume and choose new EC2 instance name. Give volume name as /dev/xvdh
6. Within seconds, you should see this volume in your EC2 instances. e.g

cat /proc/partitions 
major minor  #blocks  name

 202        1    8388608 xvda1
 202      112    8388608 xvdh

7. Create a new directory and mount this volume
#mkdir /newdir
#mount /dev/xvdh /newdir

8. You can copy your blog files from /newdir/var/www/html (document root). Also any config files can be restored from old machine.
9. Import the mysql database from mysql dump
10. Once this is done, you can test whether your site is working fine.
e.g

UPDATE wp_options SET option_value = replace(option_value, 'http://oldsite', 'http://ec2-instance-name') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://oldsite','http://ec2-instance-name');
UPDATE wp_posts SET post_content = replace(post_content, 'http://oldsite', 'http://ec2-instance-name');

This way you can verify if site is working fine. Once done restore back the old name by modifying above sql or reimporting the mysql db.

11. Final step is to switch site to new EC2. I am using cloudflare for DNS management which allows instant propagation of DNS change.So I assigned new elastic IP to this EC2 instance and changed my DNS record to point to this new EC2 instance.
Other option could be that you can disassociate your old elastic IP from old EC2 and attach to the new EC2 instance.

Finding blogging tough? Just copy and do find and replace

Well this is motto followed by Guenadi Jilevski for his blog http://gjilevski.wordpress.com and he seems to get result too (14k+ hits)

Timur Akhmadeev highlighted this content plagiarism by posting links of various articles copied by Guenadi  along with original link. You will find that articles have been copied without giving any reference of source articles thereby giving a impression that it’s his articles . I have till now commented on 6 posts which have been copied from askdba.org. He justifies this by commenting on Timur’s blog with following comment

gjilevski
Posted June 10, 2010 at 12:40 | Permalink | Reply

Guys,

This is a quote of the day for Charles and Alex:

In my posts, I have actual screenshots of my own personal domain name servers that do not exist in the original source from which I am accused of stealing content from. This proves that my work is original because I have my own personal Oracle database systems that show the content in the screen shots.

For instance, I cannot simply do a cut and paste into an image unless I have performed the actual installation and configuration as my own work. This also applies for the rest of the content without images. References to Oracle documentation and third party sources will be verified and credited to comply with international copyright laws.

If anyone has a dispute that contests the nature of my posts and believes it to infringe on copyright law, please email me at your convenience. Otherwise, I will assume by your tacit acquiescence that I am not in violation of copyright laws. If anyone believes that my blog posts contain content that has not been credited, please contact me so I can rectify the situation.

This definition of copyright by Guenadi is not correct which was later pointed by Charles Hooper.  He has also made it clear  that  unless original blog author complaints, he will not remove the article.

In above statement, he  mentions that he has performed actual installation and did the steps. I saw this post (check snapshot below) where in he copied my article on Oracle wallet and was amazed by sheer coincidence of wallet files having same timestamp 🙂 Below snapshot proves that this too is a false claim

See blogging is not tough. Get hold of any article, replace table name/username with yours. If you can change timestamp of files/error messages it will add more credibility to your articles. And if you really want to make a difference then change database name/host names in images using any image editing tool 🙂

Happy Blogging 🙂

Don’t blindly implement Blog suggestions on your Production Servers

Don’t blindly implement Blog suggestions on your Production Servers. This post is prompted by a recent issue where in DBA had modified racgvip script based on suggestion on one of blog (won’t name it).  Any such suggestions or similar to these which involve modification of oracle provided scripts should always be verified with Oracle Support.  Anyways I have put comment on the blog entry to correct or put a disclaimer 🙂

WordPress 2.8 “Baker” Released

WordPress version 2.8 has been released. Following link contains video demo of changes in V2.8.

I found option of installing theme directly from WordPress themes the coolest feature. It is not new for people using the free wordpress account’s  but for people using wordpress on their own domains had to first download the theme from net and then ftp back to their  hosting server (I am using yahoo webhosting which provides only ftp access , no ssh access). 

I do not see any note on how to Upgrade V2.7.1 to V2.8. If you try using the WordPress Automatic upgrade tool in V2.7.1, it gives a message that ” You are already on latest Release”. Anyways I am looking forward to upgrading it to V2.8 asap as it gives me option of trying out new themes 🙂 . In case anyone find’s any article on how to do it, then do let me know.

Update : – Now Upgrade link has come up on Dashboard ..May be the developers forgot about it initially 🙂

– Amit

Upgrade to WordPress 2.7.1

WordPress 2.7.1 is out..While using upgrade button, it will be stuck at downloading files and will not proceed further. This issue will be faced by people using “Automatic Upgrade” plugin available in prior release. You need to disable the plugin and then re-try the operation. Also note that you have to take a “Backup ” of database as the plugin does not take automatic backup.

WordPress Automatic Upgrade plugin did not work for me , as this gave message for my 2.7 installation

“Congratulations!!! Your WordPress version is already up to date”

So you can easily go ahead and disable this plugin and use the Upgrade option available with WordPress 2.7

Cheers
Amit

10,000 Hits – First Milestone

Hi All. Yesterday we crossed 10,000 Blog Visits on our 2.5 month old blog . Actually this blog was started 5 months back on blogger and after some time we moved to wordpress hosted blog. After moving to wordpress, we saw our blog gaining popularity with 5000+ blog visits. At that time we decided to move to our own domain. Then came up setting up of blog and creation of site which was quite a learning experience for me (Considering the fact that I did not had any experience in Web designing and just knew basic HTML).

Anyways we used WordPress for hosting the blog which has been recognized as best blogging platform till date. We moved to this address on 10 June 2008 and having 10000 hits is really great achievement for us.

Below are some Stats for our blog.

Blog Visits - 10000+

Blog Subscribers - 18

Busiest day: 350 — Tuesday, August 26, 2008

Top Posts for all days ending 2008-08-30 (Summarized)

Title	                                      Views
Oracle Database 11G Installation on Sola	744
ORA-15063 - ASM Discovered Insufficient 	488
Resolving Shutdown Immediate Hang Situat	465
Automatic Storage Management (ASM) FAQ	        394
Adding new ASM disk to RAC database fail	352
CRSCTL CheatSheet	                        322
AWE -What is It and How to use it?    	        296
ASM Disk Discovery	                        279
11.1.0.6 ASM installation on Solaris fai       	262
HW enqueue contention with LOB	                255
Simplified Approach to Resolve ORA-4031  	245

Apart from page visits, we have blog views from ORANA.info (thanks to Eddie Awad for adding this blog) and feed subscribers. Below is snapshot from feedburner

Feedburner Subscriber Stats

Feedburner Subscriber Stats

We have also started a Database Forum where people can ask questions. So in case if you have any question and you do not find any related post, then you can ask it here and we will try out best to answer it.

Thanks to all our Readers for their interest!!