Cannot execute as the database principal because the principal "dbo" does not exist
You need to give the database a valid owner. Use the ALTER AUTHORIZATION command to do this:

ALTER AUTHORIZATION 
ON DATABASE::[DatabaseName]
TO [A Suitable Login];


Related Knowledge Base article

Note the sp_changedbowner system stored procedure has been deprecated in favour of ALTER AUTHORIZATION.