Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Is it possible to operate the forum from 2 different domains?

ddumontddumont ✭✭
edited July 2012 in Vanilla 2.0 - 2.8

so for instance... I've had www.domain.com for years... but I want to migrate the forum to www.foo.com cause I just bought it and I like it better.

The migration is likely to take a long time and there's stuff at www.domain.com that needs to still work for a while (ssl related and such) but I would like to start pointing new users to www.foo.com.

Any advice?

There was an error rendering this rich post.

Comments

  • Side note, the machine will be the same... same ip, 2 domains

    There was an error rendering this rich post.

  • 422422 Developer MVP

    How would you handle ajax requests?

    There was an error rendering this rich post.

  • ddumontddumont ✭✭
    via Email
    Not sure what you mean... I would hope that they would go to whatever
    domain the site is currently loaded on.

    There was an error rendering this rich post.

  • 422422 Developer MVP

    I didnt think, without tons and tons of edits.. to the core, that you could send data from one domain to another using ajax. One of the fundamental laws of ajax is same domain requests.

    Just a point, I am no expert

    There was an error rendering this rich post.

  • You wouldn't be though... if you load the site on www.foo.com, it would send the ajax request to www.foo.com...

    I want the same forum on both domains while i transition until I shut off the old one.

    There was an error rendering this rich post.

  • 422422 Developer MVP

    Okies,.. then I dont see an issue, if they both share the same db. Just not sure what would happen if two users one on each domain, performed an action simultaneously, could it cause data collisions.

    Perhaps , @Todd could help.

    There was an error rendering this rich post.

  • ToddTodd Chief Product Officer Vanilla Staff

    So when I develop locally the forum is set up to work from vanilla.local and localhost/vanilla and I sometimes have both going at once so I can be signed in with two different users. It seems to work okay for me. The only issues that I can think of off the top of my head:

    1. Category urls are cached so if you have memcached turned on (unlikely) then you'll go to a random domain when clicking on a category.

    2. I think embedding stores the domain in your config and there can be only one.

  • @Todd

    1 more question I just thought of...
    What about all of the trust relationships with the google/twitter/fb sign-in.

    I know I'll need to regen all the keys and stuff with fb, twitter, and junk... but won't it recognize there's already an account and ask the users to provide a password (which they might not have)?

    Are there any forum migration tools that will let me reset their passwords, en masse, so they are not locked out of their own accounts?

    There was an error rendering this rich post.

  • fh111fh111 Vanilla Padawan ✭✭

    why don't you migrate your forum from domain.com to foo.com and then redirect domain.com to foo.com?

  • @fh111 Can't do that yet, there are still applications out in the wild that are accessing resources (with hardcoded self-signed certs) on the old domain. I need more time to migrate stuff over and push out all the updates.

    I'll be able to do the migration soon I hope, but I'm still worried about the people who have signed in and created their accounts with the oauth plugins. The keys will have to change, and when I tried it ( i knew it would fail ) it detected my account on the forum and asked me to sign-in with the password. If a user never made a password and I changed everything over, they would be locked out.

    There was an error rendering this rich post.

  • TreyTrey Charlotte NC New

    I think that if you upload the same files from domain.com to foo.com, update the config file with the info needed to work with twitter and facebook, and then clear the cache it should work fine.
    It would still use the same database and those values would be the same but I dont see how it could cause any problems there..

    as for the people that signed in using facebook or twitter, I can see that being a problem, but their info is also stored in the database so if they went to sign in it would ask for their permission again from facebook or twitter, and then it should sign them in with the UserID thats in the field.. I havent tested this, but i could see it working right..

  • @Trey Both domains are pointed to the same machine with the same forum install

    Also, I tried it and it detects the account and asks you to supply the password to join the accounts and let you use the sign-in plugin.... but these accounts don't have passwords.

    There was an error rendering this rich post.

  • TreyTrey Charlotte NC New
    edited July 2012

    @ddumont well I was going to say to have your members that used the twitter sign to update their email address's and if they didnt set a password, logout and do the forgot password link to reset their password to something they know but vanilla doesnt have a forgot password link.. that may be a good plugin to add to the site..

  • I guess. I think it should be part of core TBH. It's a very basic forum feature that nearly every forum has.

    If I get some time I'll try to see if I can work up a patch, but honestly @Todd could do it much faster :)

    There was an error rendering this rich post.

  • 422422 Developer MVP
    edited July 2012

    In facebook oauth, i thought you could add muliple domains. Facebook applications dev tools

    There was an error rendering this rich post.

  • I don't know much about the facebook and twitter stuff, but I remember something else that you might need to take into consideration : Do you point to Urls in your forum posts (like we do on vf.org)? Then all those Urls still point to the old domain (and Topic ID). It might be easy to redirect using .htaccess, but still something to remember :-)

    There was an error rendering this rich post.

  • ToddTodd Chief Product Officer Vanilla Staff

    You don't have to change anything in Vanilla. You do have to change your application settings in Facebook. Twitter isn't strict about the domain (for now) and Google uses oauth that doesn't care.

  • @Todd
    When I do that, won't the tokens change? Will the forum know that it's still them? When I tried it on my server (before changing the keys) I tried signing in with google on the new domain. I got as far as the "you already have an account, please enter the password" message.

    I'm worried that if I change the settings people without passwords won't be able to log in.

    There was an error rendering this rich post.

  • I can show you if you want to try it out. The domains are both live and pointing to the same server.

    There was an error rendering this rich post.

  • ToddTodd Chief Product Officer Vanilla Staff

    Facebook and Twitter both store uids that don't change so it should be okay. With openID we store what they give back. I'm not sure if it changes, but since there is no domain config with openID I'd be surprised if they somehow store it.

    I guess what you'll see is people will only be able to sign in to Facebook through the one domain that is whitelisted in Facebook.

Sign In or Register to comment.