-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate 3rd party Search Replace DB script #13
Comments
Not at the moment. I'm planning on making use of a 3rd party script to integrate this. However pull requests are more than welcome. |
@alkah3st I've recently upped by knowledge of NPM. I now understand we can reference a Git repo as a dependency. Therefore I propose the following
If you're experienced in Grunt/Node I'd welcome some help on this. |
Sweet, searchreplacedb is exactly the script I use to do the find/replace. I'm not by any means a pro with Grunt/node but I'll see what I can do. |
Should be pretty simple. I'm planning to get to this Thurs/Fri |
@alkah3st if you're interested I've made some good progress on this at https://github.com/getdave/grunt-deployments/tree/feature/advanced-search-replace Requires a lot of testing however. Would you be able to give it a whirl and see if it works for you? |
Awesome, I'll check it out this weekend. I just in fact was retooling my own website, so I can experiment on it there. |
That would be much appreciated. Be sure to do a fresh install. Dependencies have changed a lot. NPM update... Cheers |
@alkah3st Just checking to see if you've had any chance to test this out? |
Hi Dave, sorry I have disappeared from the face of the earth these past two months. I've been settling into a new job. Quick question I have about your advanced search/replace deployments script: I have everything set up properly in my gruntfile, but what's not clear to me is steps 1) and 2) you described above:
I understand I need to include a reference to searchreplacedb2 script in my package.json, but am I including the git path (i.e., https://github.com/interconnectit/Search-Replace-DB.git) in the package like so: "grunt-deployments": "~0.2.0", Also I'm not sure what you mean by #2. |
@alkah3st Not a problem. I've actually already done most of the work on this branch https://github.com/getdave/grunt-deployments/tree/feature/advanced-search-replace Check out this branch and give it a whirl. I'm interested to see what issues you encounter. |
Ah cool, that's the one I'm testing out. I have an environment where I'll regularly be moving a WP site from dev -> stage -> live, so I think this would be an ideal test. |
@alkah3st I would be great if you could test this. Be careful with it as it's not production-ready code yet! |
Here's a question for you: so I have everything set up in my external file: { as .dbpass, and the task in my gruntfile is:
When I run db_pull --src="local" --dest="develop" I get this error: "Warning: An error occurred while processing a template (Cannot read property 'local' of undefined). Use --force to continue." Is "untracked_targets" correct to reference the external file with the credentials? |
Thanks for giving this a shot. I've tried to help below...
You can name and reference the external file however you'd like. A good explanation of how to achieve this is found on the readme. My file is similar to the below: {
"local": {
"title": "Local",
"database": "my_db_name",
"user": "my_db_user",
"pass": "my_db_pass",
"host": "localhost",
"url": "www.test.local"
},
"develop": {
"title": "Development Server",
"database": "my_db_name",
"user": "my_db_user",
"pass": "my_db_pass",
"host": "localhost",
"url": "www.mydevurl.com",
"ssh_user": "my_ssh_user",
"ssh_host": "111.111.11.11"
}
} ...and the portion of the my Gruntfile which references it is: grunt.initConfig({
db_fixture: grunt.file.readJSON('test/fixtures/basic_config.json'), // the path can be to any location where you'd like to store the config file
deployments: {
options: {
backups_dir: ''
},
local: '<%= db_fixture.local %>', // make sure you've created valid fixture DB creds
develop: '<%= db_fixture.develop %>' // make sure you've created valid fixture DB creds
},
// remainder of Gruntfile continues...
In hindsight the use of
This is because it cannot find a reference to "local". You will need to double check that the script has a "local" target. Hopefully it's just a minor typo rather than an issue with the script. Happy to help you get this working. Sorry it's been less than smooth so far! |
Awesome, I will try this out once I get to the office! |
@alkah3st Did you have any luck? |
New RequirementNow that the original SearchReplaceDB repo has been updated to include a package.json file this project should reference the original repo as a dependency rather than my forked version. This should be updated in |
Hi Dave, so I was diving back into this, but now it's not clear to me how I'm supposed to include the new version. My package.json references grunt-deployments:
I'm including a config file as dbpass.json, and this is my gruntfile:
What am I missing here? |
Hmmm...that's a good point. Not sure of the top of my head how you'd reference a feature branch on Github via `package.json. Might be easier to test the new Search & Replace branch in isolation from your Sorry if this is making things difficult for you. |
Following these comments with interest, am I right in thinking the Search Replace DB feature branch hasn't been merged into the master as of yet? |
That's where I'm confused too... Not sure how to run this independently of the master. |
@davemac @alkah3st Sorry guys. Appreciate this is confusing. The Search Replace DB is on a branch at: https://github.com/getdave/grunt-deployments/tree/feature/advanced-search-replace I would advise that you create a clean dir on your local machine and then clone a fresh copy of the repo. You can do this using
That should do it. From there you should be able to test the functionality. Alternatively, if you already have a project setup which makes use of Grunt Deployments then I believe you can modify your http://stackoverflow.com/questions/16350673/depend-on-a-branch-using-a-git-url-in-a-package-json So you'd refer to the branch |
Also I'm consider making this an optional feature. So the idea would be
Also note this task which relates to this quite well #41 |
Thanks Dave, my vote would certainly be to make search replace db an optional feature. That would then make things easier for users, I suppose - but more work for you! |
OK have tried to add the advanced search replace feature branch to package.json: "devDependencies": { But am getting an error when I run
|
Worked it out, you need to delete After hours of googling, I found an explanation here http://howtonode.org/managing-module-dependencies |
@davemac Nice work sir! |
@davemac If it's possible to advise on your progress with testing this. Has it worked for you? Any major errors? Any suggested improvements. As always pull requests into the correct branch are welcome. I'd really like to get this released so I'm really appreciative of your testing efforts! |
Does the find/replace part of this task account for serialized data?
The text was updated successfully, but these errors were encountered: