HTTP 500 error when updating a page

Your if statment is using an alternative syntax so it needs to be in the following structure which changes the standard opening brace { to a colon : and the closing brace } to endif;

if ($post_object): 
    // Code if true
    else: 
    // Code if false
endif

I’m not sure this will fully fix your problem as there could be different PHP versions on the new server with deprecated functions in the theme, but it should help.