Skip to content

Commit c5fc6c5

Browse files
authored
Merge pull request #9 from cvn/issue-8-fix
clone_wp_site.py: Update database config properly
2 parents 0ef0e00 + bf52ca3 commit c5fc6c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/clone_wp_site.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ def main(args):
148148
log.info(f'Copying files')
149149
sshrunner.run_passbased_rsync(f'{src_app_path}/', f'{userhost}:{dst_app_path}/')
150150

151+
log.info(f'Updating database configuration')
152+
sshrunner.run_passbased_ssh(f'/home/{DST_OSUSER_NAME}/bin/wp --path={dst_app_path} config set DB_HOST {dst_db_host}')
153+
sshrunner.run_passbased_ssh(f'/home/{DST_OSUSER_NAME}/bin/wp --path={dst_app_path} config set DB_USER {dst_db_user}')
154+
sshrunner.run_passbased_ssh(f'/home/{DST_OSUSER_NAME}/bin/wp --path={dst_app_path} config set DB_PASSWORD {dst_db_pass}')
155+
sshrunner.run_passbased_ssh(f'/home/{DST_OSUSER_NAME}/bin/wp --path={dst_app_path} config set DB_NAME {dst_db_name}')
156+
151157
log.info(f'Copying database content')
152158
sshrunner.run_passbased_scp(sql_filepath_local, f'{userhost}:{sql_filepath_remote}')
153159
os.remove(sql_filepath_local)

0 commit comments

Comments
 (0)