 What is going on everybody? My name is Roddy and you're watching my channel Roddy the Brand. Today I'm going to show you the full process of migrating a WordPress website to AWS LightSale. We're going to explore how to create an AWS LightSale instance, how to access the WordPress admin dashboard by finding the username and the password, how to point a domain name to the AWS instance. We will also explore how to set up a free SSL certificate. We will also explore how to access the PHP admin locally, which is a little bit of a pain. And we will explore in detail how to backup your current website using cPanel and migrate that website to AWS. And in the end, I will show you a plugin, an SMTP plugin that you can use for the delivery of your emails. This video will be timestamped so you can quickly skip to the part of the video that you're interested. And everything will be detailed on my blog post as well. The link will be in the description below. Before we begin, if you're feeling generous, please like the video, consider subscribing to my channel. And if you have any questions, please comment below. And now let's jump to the computer and get started. Welcome everybody and let's get started. First of all, navigate to aws.amazon.com slash lightsale and have a look around. Have a look at the overview, have a look at the features and the pricing. Once you're happy, go ahead and click on get started with lightsale for free. I've actually already done that. So what I'm going to do is just sign into the console. Once you're in the console, all you have to do is select lightsale. This is the page that we want to be on. As you can see, I've already got an instance here, which I'm using for my personal blog. But today we're going to create a new instance. I'm going to show you how to set up a brand new WordPress website. Then after that, we will migrate an existing WordPress website to AWS lightsale. So let's get started by creating a new instance. Click on the orange button here. There are a couple of things that we need to do. The first thing that we need to do is set up or instance location. What you can do is either set up your location to the nearest location for you or set up your location to the country where most of your users come from. Especially if you don't have CDN, maybe that would be your best option. So if most of my users came from Germany, I would probably go for Frankfurt or if most of my I'm going to go with London just because this is closest to me and leave it as it is. Now let's scroll down. The second thing that we need to do is pick up or instance image. And this one is easy. We're going to go with Linux. Then up OS will be WordPress. Of course, you can set up a WordPress multi website as well by selecting this. But today we're just going to be focusing on a normal WordPress instance. So let's scroll down and have a look at what else we can do. The other thing that you can do is enable automatic snapshots. But I'm not going to do that now. I'm actually going to delete this instance after we're done. The next step is to choose your instance plan. Now the beautiful thing about this is that you can upgrade anytime. For now, I'm just going to go with the cheapest option. And as you can see, the first month is free, which is great. So let's select this, go down. Now we need to give our instance a name and the website that I will be migrating is called we make logos. So let's just type we leave it as it is. So let's create the instance. And this should take a couple of seconds. As you can see, it's pending in the moment. It should be available anytime soon. So I might just speed up the video fee so we don't have to waste any time. OK, I just refreshed. And as you can see, our instance is already running, which is great. And also, you might notice that our IP address is slightly different than this one. And that's fine. We'll figure all this out in a second. First of all, let's go to the new instance that we just created. WordPress dash we make logos. And if you scroll down, actually, as you can see, for instance, is running, which is great. Now we have to copy the public IP address here and paste it in the address bar. As you can see, our instance is working. Sometimes it might take a little bit longer for it to work, but just be patient, give it like a minute or two, and it should be working. As you can see, we now have a WordPress working, which is great for some of these setting up a new WordPress instance might be good enough. For that reason, let's have a look at how we can get the username and password so you can log into the admin panel. Obviously, to log into the admin panel, all you have to do is under IP address you can do slash WP dash admin. And now we need to find the username and password. The username should be actually just user. In order for us to find the password, we need to go back to the Amazon light sale inside here under the connect tab. You will see connect with SSH. Let's click on that and have a look at how we can get the password to get the password. First of all, what we can do is list all the elements in the directory current directory. Sorry. So let's do LS. And this is what we need. The bitnami application password. So what we can do is cut bitnami underscore application underscore password press enter. And this will give you the password for your WordPress. Now you can try to copy it from here like so with command and see, but if this doesn't work, you can always use the copy the copy button from here. And this will give you the password. If this was copied correctly, we can go back and type user and then just paste the password and press log in. Okay. As you can see, this worked for me. So you're pretty much set. You have a brand new WordPress website, which works. You can always go under users and change your password and so on. But we'll leave this. The next thing that we might want to do is point or domain name to work on this. Now my domain names hosted with 123reg. So let's go there and I'm going to log in to my account. Navigate to the domain name that I want to point. And this will be the we make logos.co.uk. I'm no longer going to be using this anymore. So I'm using it for training for learning purposes. And the next thing that we need to do is find the manage DNS settings. Now, obviously, depending on where your domain name is, the menu will be slightly different. But just have a look at the manage DNS settings. So I'm going to go and click on this and then I'm going to advance DNS settings and inside here is where we need to basically change the A-Racket. Now before we do this, let's go back to the actual WordPress instance here on Amazon LightSale. And the thing is that I could point the A-Racket to this public IP. But I believe that this IP changes if we restart, if we reboot the server. Or I think it changes from time to time. So what we have to do is actually go under networking. And we need to create a static IP so it doesn't change. So let's do that. Just create static IP and we can, yes, select this. Create static IP. And I'm just going to use this to static IP to we make an address and then just click create. All right, we should be able to use this static IP now. So we copy this and go back to the browser and paste this. As you can see, our website is working, which is great. And technically speaking, we should be able to go and manage all DNS settings. Let's just change the A-Racket. Hopefully, just by changing this and I change the WW1 as well, we'll leave the rest. Obviously, if you want to have a mailbox, you might have to change your MX records to the ones provided by the service you choose and so on. So this could take a little bit of time, but we'll try it in a second. But what we can do is open command line and we can do an NSLOOKUP, NSLOOKUP, and then we can type the wemakelegos.co.uk website and just see if our website, if our IP has updated. As I said, this will take a few seconds. As you can see, it hasn't updated. It might take 24 hours or but usually it's quite quick. So we'll just continue once it's done. I actually totally forgot that my NS records on this URL. So nameservice were actually managed by CloudFair. So I had to reset this so they're managed by 123reg. And this is why it does say that it could take up to 48 hours. And if I didn't remember this, then changing the DNS from here wouldn't make any difference. But now that this is changed to 123reg. They should start propagating. And in fact, I just went on the whatsmydns.net and inside here you can choose what to check. For example, your A record, address record, you can choose your nameservice record and so on. As you can see, the IP has started to propagate, which is pretty cool. So if I click on NS, this is the 123reg one. And this is the CloudFair one. So soon it will start working. Unfortunately, in the UK is not yet propagated, but let's have a look at the A record. And as you can see in some places, the new IP address is popping up, which is pretty cool. But yeah, it could take a few more minutes and then we will continue. All right, it's been a few hours now and the propagation tool is showing us good results. So the search, you will see that it's mostly done now. There are a few that are still not propagated, but that doesn't matter too much because it seems to be working in the UK. So technically, if we go to remakelogs.co.uk now, we should be able to see the website. And of course, we're getting this warning and this is because we don't have a valid SSL certificate. So what I can do from now is just click advanced and just accept the risk and continue. As you can see, this is our website, which is pretty cool. And we can now go to the next step, which will be to install the free SSL. To install the free SSL, let's go back to Amazon LightSale. And let me close some of the tabs. We probably won't need this anymore. So let's close that. Let's close that. And we are now in Amazon LightSale. Let's click on our instance that we're working on. And let's use the terminal in here. Let's click on connect using SSH. And this will open the terminal for us again. To install the SSL cert, we need to do the following commands. Let's start with sudo then slash OPT slash bitnami slash bn cert and then dash tool. Press enter. And sometimes this asks you to update the actual tool. So for example, right now it says an updated version is available. So I'm just going to press Y and enter. The tool has now been updated and we can rerun the same command as above. So if you press the up button, this should bring the same command and I can press enter again. And this should lead us to the setup of our SSL certificate. So first of all, we need to provide a valid space separated list of domains for which you wish to configure your browser. And for this, I'm just going to go with just we make logos code UK. And actually we can add the WWW version as well. So let's do WWW dot we make logos K and press enter. Enable HTTP to HTTPS redirection and press Y as yes. Press enter. Enable non WWW to WWW redirection. I'm probably going to leave this with no, but that's totally up to you. Enable WWW to non WWW redirection. And with this, I'm going to go with yes. But again, this is all up to you. The following changes will be performed to your bitnami installation. And I think that's looking good. So I'm just going to go ahead and press yes. This should take a couple of seconds. And hopefully we should be good to go. This is actually asking us for a valid email address. So I'm going to type my email address and press enter. Do you agree to the let encrypt subscribe a subscriber agreement? And yes, this should take a couple of seconds. And we should be good to go. I think that this is the last step. All right. This is obviously taking a few seconds. But what I would do is I would speed this up. All right. Everything is looking good. As you can see, we have success. And all we have to do is press enter. And we should be good to go. We can now close this terminal and check whether SSL is working. Thing is crossed. If we go back to the website, press enter. And as you can see straight away, the SSL is now working. We don't get the non secure website with the X. And if I was to click on the padlock, you can see connection is secure. Click on this arrow. And this is verified by let encrypt. And if we click on more information, we will see that this expires on the 23rd of April. So we have plenty of time. And this should automatically renew. But of course, just keep an eye on it close to April. Well, I should keep an eye on it close to April, close to the date. And just make sure that everything is working correctly. So let's close this and continue with the next step. So far so good. If you wanted to set up a brand new WordPress website with an SSL, you are pretty much good to go now. You know how to get your username and password. And you can start using your website. But if you wanted to migrate the website, we're going to have to do a little bit more work. Now, if we go back to the instance and let's say go to networking and find the IP address, normally what you could do is copy this, paste it in your URL. So I'll paste it here. And normally you could do PHP, my admin. But as you can see here for security reasons, this URL is only accessible using localhost as the host name. And to be honest, this is the most dreaded part of the whole video. There is no easy way of doing this, unfortunately. But what I can do is at least show you the safest way. I will also link the official documentation about this in the description below. And this will be also available on the blog. But basically, this is what we need to do. We need to access a server using an SSH, SSH tunnel. Okay, this could be the worst step now, but we'll take it easy. And I'll guide you step by step on how we can connect to or my SQL database. First of all, the first thing you need to do is go to this website, which will be linked in the description below and download the putty version. And as you download this, obviously choose the one for your system. I'm using the 64-bit one and I just downloaded the installer. And it's very easy to install. So I'm not going to guide you through this. You just press next, next, next, pretty much. And once you install this, this will actually install two applications, the putty application and the putty gen application. Before we do anything with this, let's go back to our instance. Click on connect and navigate to the bottom where this account page link is. We need to click on this and download or SSH key. To do this, obviously click on the download button here. And this will download the PEM key for you. I've already downloaded this, so I'm just going to press cancel. And the next step that we need to do is open the putty generator. So let's do putty gen, press enter and open the putty key generator. First of all, we need to load our SSH key that we just downloaded. So let's press on load. I'm going to go to the downloads page. And then press view all. And as you can see, I've downloaded it a few times. So I'm just going to press on this one here. Let's have default key dot PEM open this. And this is giving us a message successfully imported for a key. Press OK. And now we need to actually save this private key. Save private key, press yes. And choose the folder where you want to save your private key. And this will be useful in a second. So let's call this something like my website key and press save. All right, we are good to go. Let's close this and open the putty tool. Open the putty configuration tool and let's go step by step. First of all, we need to grab our hostname or IP address. So let's go back to LightSale, press on this. And we can just use, actually, they're the same. You can grab this or this one here under networking. So let's grab this copy and let's paste the IP address in here. Port number can stay 22. Then session, we can do my website and save the session. Then we need to navigate to SSH, expand the SSH, click on auth. And then we need to browse our private key that we just created. So browse this. And this is it here in my downloads folder. It's called my website key.ppk. Open. The next thing that we need to do is expand oath and click on, actually now click on tunnels. And inside here, we need to add the source board to be 8888. The destination needs to be localhost and then column 80. And important step in here is that you need to add this. So click on the button. Then another thing that we can do is here under connections, click on data and auto login username. We can set to be, if you go on the connect, it's bitnami. So let's copy this and paste it in here. And hopefully we should be good to go. So let's go to the top, click on session. And again, click on my website here and save this. Make sure you save this because if you don't next time, you're going to have to do the same. You're going to have to go through the same process, which as you already see, it's so painful. So let's save this and press open. All right. If you follow the instructions correctly, hopefully you should get this window. But don't worry if you didn't, just try again. I will also link the actual documentation by bitnami, which can guide you through some of the settings as well. They will be linked in the description below and also my blog. Let's close this. Let's close this. And okay. Now let's have a look at how we can actually view the database. Open a new tab and type localhost, column 8888 slash phpmyadmin. And hopefully you should get this screen, which to many of you is probably familiar. Now you're probably wondering what is your password. The username is root. And to find out the password, we need to do the same thing that we did early in this video. We need to go back to the light to Amazon light cell and click on connect using SSH. And to find the password, again, we can do cut. Actually, let's do LS. And then we can do cut bitnami underscore application underscore password. Press enter. This is your password in here. So make sure you copy and control and C, or you can copy in here, I think. In fact, control and C probably won't work. So you're going to have to press on this and copy it from here. Right now that we have all password copied, and we know that our login or username is root, let's paste our password and press go and do root and then paste the password again. Let's go. And we are finally in so much pain, but we are finally in. So your database is this one here, bitnami WordPress. And for many of you, you probably already know how to import your database from your previous website. But this will be the next step on this video. All right. Now that we know how to connect to our database, let's have a look at how we can access the files before we start replacing the database, data and the files on our server. So first of all, let's use the tool Firezilla. And this will be, this tool will be linked in the description below as well. It will allow us to connect to a web server and then we can upload files, download files, delete files and so on. So let's go to file. Okay. Before we do anything, let's go to edit settings. And we need to go to, and we need to go to SFTP and add or key file. We downloaded or key file earlier. But if you're only joining us for this part, to find your PEM key, all we have to do is go to Amazon light cell and then click on your WordPress instance, then account page and download it from here. All right. Now that we know this, open your key and have it in here. You can then press. Okay. The next step that we need to do is go to file, site manager and let's add a new website. So I'm going to call mine light cell AWS light cell AWS light cell or something like this. And we need to find out the host name. So let's go back. Host name is this IP here. I'm going to copy this one here from networking. So let's copy the IP paste port. You can leave as empty protocol. We're going to have to go with SFTP and username will be bitnami. And the password will be the one that we found earlier. But if you are joining just now, let me quickly show you. So open the command line here and do LS and do cut bitnami application underscore application underscore password. Copy the password from here and use this password. I'm sorry if you've already seen this 10 times, but some people might be joining at this stage. So copy this password, paste it in here. And connect. As you can see, this connects to or AWS instance, which is great. And now we need to find where our WordPress is. So I believe that it could be in the apps and then WordPress. Then after that, it's HD docs. And this is our WordPress website. If you are migrating the website, we obviously need to replace all those files. And we need to replace the database. So let's do that. First of all, we need to download the website that we want to migrate. The website that I'm going to migrate is currently living in GoDaddy. And we're going to access the cPanel. But of course, if you're using a different hosting provider, it might be ever so slightly different. So I'm going to go to manage. And then I'm basically looking for the cPanel. Here it is cPanel. Let's click on that. And there are two methods of actually downloading the files. The easiest one is probably just to go to backups. And it could be this one here, backup. And then you can download a full backup from here. Click on this. As you can see, I've made a lot of backups before. And let's just generate a new backup. Oh, invalid. Okay, do not send email. And I want backup of the whole directory, which could take a few moments. But basically, this will back up everything, the database, the files. And then we can replace them one by one. Go back. And we might have to wait a few moments for this backup to be... And we might have to wait a few moments for this backup to be generated. And I will be back in a second. While this is actually downloading, what we can do is actually export the database and save some time. So let's go back and find PHP MyAdmin. Obviously yours could be slightly different, but PHP MyAdmin is almost exactly the same everywhere. So let's find the database that we want to export. And for me, this is RemakeLogosDV. So click on the database. And what we want to do is click on Export. Leave the first option here and Format can be SQL. So let's press Go. And here we go. We have the database. So let's save this quickly. And as you can see, this is already downloaded. So what we can do is we can go back to the localhost of 8888. And then PHP MyAdmin. Make sure that you're still logged in. And everything is looking good. Now remember that if we delete everything from here, it will delete the user, add the username and password for your WordPress will no longer match with the one of LightSale, but will match with the original one, of course, the one that we're going to migrate. So what I'm going to do is delete all this. And this is going to break our website. So where's the delete? Drop table somewhere? I think it's this. OK, drop and then press Yes. As you can see, our database is now empty. And we need to import the other database, the one that we just downloaded. Import, browse, go to Downloads. And this is the database that I just downloaded. So let's press Open. Press Go. And this should take a couple of seconds. If your database is too large, you might have to compress it and do some magic. But hopefully, for me, it will just work. All right, everything is looking good. Pretty happy with this. The next step that we could do, and actually now if you go back to the website and refresh, you'll see that the website is now broken because we replaced the database. What we can do now, we can go back to the firezilla and we can save the config file because we can do with some of this. We can save some of the database connection settings from here. So let's drag this somewhere. I'm going to drag mine. OK, let's drag this somewhere. And I'm going to drag mine into the Downloads folder. Like so. So I have a copy of it. And then we can copy the settings to later. All right. So technically speaking, it might be just best to delete all those WordPress files now because they will be replaced with the website that we want to migrate. So let's delete this because this is going to take quite some time, I believe. Let's minimize this, go back to the hosting and see whether we can download our backup. OptumRubbit is telling me that or we make logos is now down, which is pretty cool. OK, so backups. Download the full backup. The one that I need to download is this one here. So this could take a little while as well. So let's save that. And so I'm going to leave everything. I'm going to leave this to delete all the files. And I'm going to leave this to download my backups as well. And then I will come back to you in a few moments. All right. We finished downloading the backup and we also finished deleting all the files except this folder, which should be fine. What is it? Oh, just some uploads. OK, hopefully everything should be fine. And now what we have to do is find the download, the find the backups. So here are the backups. Let me open this. And this could take some time as well because there is a lot going on. So I'm going to navigate and try to find my website. We make logos. All right. This is the folder that I want. So I'm going to extract this folder inside here as well. It should take a second to do. All right. Now that we have the website extracted here, as you can see, we have WordPress files, which is great. Before we upload or website files to AWS LightSale, one thing that I want to do is change a few things on the WP config file. And in fact, I'm just going to use the one that we downloaded earlier from the original AWS WordPress. So I'm going to open this and I'm going to open the one from the website that we want to migrate. And we're going to have to marry them. So the reason I'm doing this is because my old database was called WeMakeLegosDB. And the new one, it's called Bitnami WordPress. If you go to your localhost 88888, you will see that the database is called Bitnami and it's called WordPress. Also, you might notice that we have a table prefix here, which I've done manually a while ago when I obviously set up the website. For security reasons. So we need to make a note of this. And this is why I'm going to marry those two files together. So from the old one, I'm going to copy the table prefix, which is W. And I'm going to copy it in here instead of WP. And hopefully everything else should be fine. We can close this. And I'm actually going to upload this one here because it has all the settings from AWS and we just change the table prefix. I'm going to drag this one in here. And we should be good to go. Okay, now let's grab all the files and put them into AWS and paste. Depending on how big your website is, this could take a while. And sometimes if you have way too many files, your server might disconnect, but you're gonna have to just keep on trying and get them to upload. As you can see, this is going quite fast so far. This is why I like AWS. It's pretty fast, even on the cheapest here. And yeah, I will get back to you as soon as this is uploaded. All right, as you can see, the files are now uploaded, which is good. So if we go back to the browser and navigate to our website, everything should be working. Okay, as you can see, the website is actually working. And this is coming from a plugin, I believe, a Cummins 7 plugin. So if we go into WP Admin and try to log in with our original username and password from original website, you should see that we're able to log in. Everything is working correctly. This website is quite old and full with plugins and so on. But yeah, as you can see, everything is working well. And now that I'm logged in, hopefully, yeah, everything seems to be working. So that's pretty much it. All right, the last thing that I wanted to mention is that if you wanted to set up emails, you're gonna have to, okay, your website is up. If you want to set up emails, you're gonna have to install the plugin WP Mail SMTP. And then you can pretty much choose your SMTP settings whether you want to use Amazon SES. I'm not going to configure this. I think the easiest one to configure is probably Gritsend. And this is what I've actually done on my personal website. I've got WP Mail SMTP configured with Grits, with TenGrid, sorry. It's very easy to do. You get 100 emails a day for free. Yeah, they provide users with 103 emails per day. And if you grow after this, of course, you can pay a little bit and get your email sorted. But as you can see, this plugin, it's great. But you have to pay for some of the other stuff like the Amazon, it's not available unless you pay for it. So yeah, just have that in mind that you will need to set up SMTP. And yes, you can do it with the Amazon Web Services. And that's pretty much everything I wanted to show you today. It has been a very long and painful tutorial. I hope that some of you found it useful. I hope that you managed to make your website working. I hope that you migrated your website successfully. If you like this video, give it a thumbs up. If you feel generous, consider subscribing. Comment below if you have any questions. And thank you very much for watching. As always, my name is Rady and you're watching my channel, Rady the Brand. And the last thing I wanted to mention is that everything will be available on my blog. See you next time.