How to access migration tool in AWS EB?

So I finally managed to get Yii2 loaded up and launched on EB in AWS. The framework is able to talk to the database as expected. The issue is, there’s nothing in the database (duh, I have put anything there yet).

How do I access the console/migration tool remotely? I have migrations written and ready to go, just need to access the console to activate them.

This is where my knowledge really falls short and I don’t see any guides/tutorials on this. I would really appreciate some guidance on this one, as I’m completely lost here.

Thank you in advance.

By AWS EB2 you mean Elastic Beanstalk or EC2?

Elastic Beanstalk. My mistake.

Does anyone have any insight on this? Being able to use the migration tool is all that separates me from having a functional site.

I have never used EB before but I googled this: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.ec2connect.html

When you connect to EC2 you can get to console, right?

Thought I replied to this, but I guess not. I was able to figure it out.

You have to get EB CLI working first. Once that’s done, you setup your SSH access keys. Go through the eb configuration settings and get everything set up (amazon has tutorials on this, it’s pretty easy).

Once that’s done, SSH into your instance and navigate to /var/app/current/projectname

Once you’re in, simply type php yii migrate.

If you have triggers, you’ll need to follow this walkthrough and redo your migrations (they will fail otherwise).

https://aws.amazon.com/premiumsupport/knowledge-center/rds-mysql-functions/

Once that’s done, run migration again and profit.

Hope this helps someone!

1 Like