How to move the wordpress site from test url to main url? [duplicate]

I personaly do that in 3 steps:

1) in the admin i change both wordpress and site adresses from ‘domainname.com/test/’ to ‘ domainname.com/’. After saving it’ll break the site, no worries.

2) i move ftp files from the /test/ folder to the root one (gives back the admin and site).

3) i finally change database datas that refer to the old url ‘…/test/’ by using the plugin search and replace. Gives back all the pictures uploaded for exemple.

Did it again this morning, works fine.
And as pootzko says, backup backup, you never know what can happen.